Created
November 5, 2014 08:25
-
-
Save spoike/4a49be27b1b30cacb759 to your computer and use it in GitHub Desktop.
As response for Twitter message: https://twitter.com/simenbrekken/status/529908576966688769
This file contains 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
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