Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Commit 47c2e57

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents f5708ce + b0ad25a commit 47c2e57

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ const createStoreWithMiddleware = applyMiddleware(reduxRouterMiddleware)(createS
6565

6666
const store = createStoreWithMiddleware(reducer)
6767

68-
// Sync store to history
69-
reduxRouterMiddleware.syncHistoryToStore(store)
68+
// Required for replaying actions from devtools to work
69+
reduxRouterMiddleware.listenForReplays(store)
7070

7171
ReactDOM.render(
7272
<Provider store={store}>
@@ -117,6 +117,7 @@ Examples from the community:
117117
* [tj/frontend-boilerplate](https://github.com/tj/frontend-boilerplate)
118118
* [bdefore/universal-redux](https://github.com/bdefore/universal-redux) - npm package for universally rendered redux applications
119119
* [yangli1990/react-redux-isomorphic](https://github.com/yangli1990/Isomorphic-Universal-React-Template) - boilerplate for universal redux and redux-simple-router
120+
* [StevenIseki/redux-simple-router-example](https://github.com/StevenIseki/redux-simple-router-example)
120121

121122
_Have an example to add? Send us a PR!_
122123

@@ -128,15 +129,15 @@ _Have an example to add? Send us a PR!_
128129

129130
Call this to create a middleware that can be applied with Redux's `applyMiddleware` to allow actions to call history methods. The middleware will look for route actions created by `push`, `replace`, etc. and applies them to the history.
130131

131-
#### `ReduxMiddleware.syncHistoryToStore(store: ReduxStore, selectRouterState?: function)`
132+
#### `ReduxMiddleware.listenForReplays(store: ReduxStore, selectRouterState?: function)`
132133

133-
Call this on the middleware returned from `syncHistory` to start the syncing process between the history and store instance.
134+
By default, the syncing logic will not respond to replaying of actions, which means it won't work with projects like redux-devtools. Call this function on the middleware object returned from `syncHistory` and give it the store to listen to, and it will properly work with action replays. Obviously, you would do that after you have created the store and everything else has been set up.
134135

135136
Supply an optional function `selectRouterState` to customize where to find the router state on your app state. It defaults to `state => state.routing`, so you would install the reducer under the name "routing". Feel free to change this to whatever you like.
136137

137138
#### `ReduxMiddleware.unsubscribe()`
138139

139-
Call this on the middleware returned from `syncHistory` to stop the syncing process set up by `syncHistoryToStore`.
140+
Call this on the middleware returned from `syncHistory` to stop the syncing process set up by `listenForReplays`.
140141

141142
#### `routeReducer`
142143

0 commit comments

Comments
 (0)