react-utils-helper
Version:
A bunch of helper components for React
22 lines (12 loc) • 347 B
JavaScript
;
var AppDispatcher = require("dispatcher/App");
module.exports = {
dispatcherTokens: [],
registerAppDispatcher: function(fn) {
this.dispatcherTokens.push(AppDispatcher.register(fn));
},
componentDidUnmount: function() {
for(var i in this.dispatcherTokens)
AppDispatcher.unregister(this.dispatcherTokens[i]);
}
};