Last active
March 11, 2017 09:32
-
-
Save byverdu/2552684d8bc7538d4c1ebebdf2cf6746 to your computer and use it in GitHub Desktop.
post code sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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