Last active
August 29, 2015 14:27
-
-
Save dleavitt/b50b1e2cbda15efd79fb to your computer and use it in GitHub Desktop.
Alt Actions Inheritance Example
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
import Alt from 'alt'; | |
let alt = new Alt(); | |
class AnimalActions { | |
run() { | |
// do some stuff | |
this.dispatch(); | |
} | |
} | |
class HogActions extends AnimalActions { | |
forage() { | |
this.dispatch(); | |
} | |
} | |
// AnimalActions aren't returned by Object.getOwnPropertyNames | |
let hogActions = alt.createActions(HogActions); | |
hogActions.forage() // yep | |
hogActions.run() // nope |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution?