Skip to content

Instantly share code, notes, and snippets.

@spoike
Created November 5, 2014 08:25
Show Gist options
  • Save spoike/4a49be27b1b30cacb759 to your computer and use it in GitHub Desktop.
Save spoike/4a49be27b1b30cacb759 to your computer and use it in GitHub Desktop.
var Errors = Reflux.createActions(['error1', 'error2' /*, 'error3' */]);
var ErrorNotificationStore = Reflux.createStore({
init: function() {
_.each(Errors, function(action) {
this.listenTo(action, this.onError);
}, this);
},
onError: function(errorMessage) {
/* whatever you want to do with errorMessage and this.trigger(...) */
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment