Skip to content

Instantly share code, notes, and snippets.

@byverdu
Last active March 11, 2017 09:32
Show Gist options
  • Save byverdu/2552684d8bc7538d4c1ebebdf2cf6746 to your computer and use it in GitHub Desktop.
Save byverdu/2552684d8bc7538d4c1ebebdf2cf6746 to your computer and use it in GitHub Desktop.
post code sample
// build IA
import Human from 'forgotten/species';
import Utils from 'some/crazy/path';
@Uitls
@Human
export default IA extends Human {
constructor(type, ram) {
super(name, sex)
this.type = type;
this.ram = ram;
}
destroy(human) {
const latestHuman = Human.all().find(human);
try {
Utils.destroy(latestHuman);
} catch (error) {
throw new Human.error(error)
}
}
}
const skynet = new IA('skynet', 'hybrid', Utils.killer, 1000);
skynet.destroy({name: 'Albert'}) // 'Sorry, Albert was coding :)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment