Skip to content

Instantly share code, notes, and snippets.

@goatslacker
Created February 10, 2015 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goatslacker/d13b45d54c4799e3f475 to your computer and use it in GitHub Desktop.
Save goatslacker/d13b45d54c4799e3f475 to your computer and use it in GitHub Desktop.
class MyActions {
asyncAction() {
setTimeout(() => {
this.dispatch('foo')
})
}
}
var myActions = alt.createActions(MyActions)
class MyStore {
constructor() {
this.bindActions(myActions)
this.foo = null
}
onAsyncAction(foo) {
setTimeout(() => {
this.foo = foo
this.emitChange()
})
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment