diff --git a/docs/guides/flux.md b/docs/guides/flux.md index 29bf63d15c..da49cfa6f4 100644 --- a/docs/guides/flux.md +++ b/docs/guides/flux.md @@ -117,6 +117,21 @@ To avoid this, you can do one of three things: ``` +Accessing route and params from action creators +--------------------------------- + +You can create your own `RouterStore` and fire an action in `run` callback: + +```js +Router.run(routes, (Handler, state) => { + ActionCreators.changeRoute({ state }); + React.render(, document.body); +}); +``` + +Let `RouterStore` keep router state and add a public method to obtain it. +This way your action creators and other stores can learn about current router state. + Handling route changes as actions ---------------------------------