redux-routing
Universal routing built on top of redux.
For usage with React see example/main.js. See redux-routing-universal-example for an example of a universal application that renders on both client and server.
install
npm install redux-routing --save
how it works
// define routesconst routes = // create routing middleware, set up with HTML5 Historyconst middleware = // create store with middlewareconst createStoreWithMiddleware = createStoreconst store = // subscribe to changesstore // start navigatingstore// logs 'navigated to /'store// logs 'navigated to /foo'store// logs 'navigated to /foo/:bar'store// logs '404 not found'
See path-parser for more detail on defining routes.