Skip to content

Instantly share code, notes, and snippets.

@barberdt
Created October 26, 2015 17:36
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 barberdt/1904ee53573c08b01aca to your computer and use it in GitHub Desktop.
Save barberdt/1904ee53573c08b01aca to your computer and use it in GitHub Desktop.
class MyActions {
constructor() {
this.generateActions('loadSuccess', 'loadFailure');
}
load() {
this.dispatch();
asyncLoad()
.then(resp => this.actions.loadSuccess(resp))
.catch(error => this.actions.loadFailure(error));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment