react-crossroads
Version:
Client side router for web applications built with React and utilizing the Flux architecture. The backing routing engine is CrossroadsJs.
37 lines (26 loc) • 939 B
JavaScript
var Logger, RouterConstants, RoutingDispatcher;
RouterConstants = require('../constants/RouterConstants');
Logger = require('../utils/logger');
RoutingDispatcher = (function() {
function RoutingDispatcher(dispatcher) {
this.dispatcher = dispatcher;
}
RoutingDispatcher.prototype.handleRouteAction = function(action) {
Logger.debug.log("Router Dispatching: " + (action != null ? action.actionType : void 0));
return this.dispatcher.dispatch({
source: RouterConstants.ROUTER_ACTION,
action: action
});
};
RoutingDispatcher.prototype.register = function(handler) {
return this.dispatcher.register(handler);
};
RoutingDispatcher.prototype.unregister = function(id) {
return this.dispatcher.unregister(id);
};
RoutingDispatcher.prototype.waitFor = function(ids) {
return this.dispatcher.waitFor(ids);
};
return RoutingDispatcher;
})();
module.exports = RoutingDispatcher;