UNPKG

react-crossroads

Version:

Client side router for web applications built with React and utilizing the Flux architecture. The backing routing engine is CrossroadsJs.

26 lines (17 loc) 740 B
var LocationStore, RouteStore, RouterActions, RouterContext, RoutingDispatcher; RoutingDispatcher = require('../dispatcher/RoutingDispatcher'); LocationStore = require('../stores/LocationStore'); RouteStore = require('../stores/RouteStore'); RouterActions = require('../actions/RouterActions'); RouterContext = (function() { function RouterContext(dispatcher) { this.dispatcher = new RoutingDispatcher(dispatcher); this.stores = { location: new LocationStore(this.dispatcher, this) }; this.actions = new RouterActions(this.dispatcher, this.stores); this.stores.route = new RouteStore(this.dispatcher, this.stores.location, this.actions); } return RouterContext; })(); module.exports = RouterContext;