react-crossroads
Version:
Client side router for web applications built with React and utilizing the Flux architecture. The backing routing engine is CrossroadsJs.
24 lines (16 loc) • 537 B
text/coffeescript
RouterConstants = require '../constants/RouterConstants'
Logger = require '../utils/logger'
class RoutingDispatcher
constructor: (@dispatcher) ->
handleRouteAction: (action) ->
Logger.debug.log "Router Dispatching: #{action?.actionType}"
@dispatcher.dispatch
source: RouterConstants.ROUTER_ACTION,
action: action
register: (handler) ->
@dispatcher.register handler
unregister: (id) ->
@dispatcher.unregister id
waitFor: (ids) ->
@dispatcher.waitFor ids
module.exports = RoutingDispatcher