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

Commit cff1c38

Browse files
committed
Update README.md
1 parent 6a9f0d2 commit cff1c38

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
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}>
@@ -128,9 +128,9 @@ _Have an example to add? Send us a PR!_
128128

129129
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.
130130

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

133-
Call this on the middleware returned from `syncHistory` to start the syncing process between the history and store instance.
133+
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.
134134

135135
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.
136136

0 commit comments

Comments
 (0)