@@ -31,7 +31,7 @@ npm install redux-simple-router
31
31
32
32
[ redux-router] ( https://github.com/rackt/redux-router ) is another
33
33
project which solves the same problem. However, it's far more complex.
34
- Just look at this code: the whole thing is only 68 lines of JS .
34
+ Just look at this code: the whole thing is only a small JS file .
35
35
redux-router is much bigger and more complex.
36
36
37
37
That said, redux-router is a fine project and has features this
@@ -154,15 +154,26 @@ piece of state must be named `routing`** (unless you provide a custom
154
154
155
155
### ` UPDATE_PATH `
156
156
157
- An action type that you can listen for in your reducers.
157
+ An action type that you can listen for in your reducers to be notified of
158
+ route updates.
158
159
159
- ### ` updatePath (path, noRouterUpdate )`
160
+ ### ` pushPath (path, state, { avoidRouterUpdate = false } = {} )`
160
161
161
- An action creator that you can use to update the current URL. Just
162
- pass it a string like ` /foo/bar?param=5 ` .
162
+ An action creator that you can use to update the current URL and update the
163
+ browser history. Just pass it a string like ` /foo/bar?param=5 ` as the
164
+ ` path ` argument.
163
165
164
- The ` noRouterUpdate ` , if ` true ` , will stop react-router from reacting
165
- to this and all future URL changes. Pass ` false ` to make it start
166
- reacting again. This is useful if replaying snapshots while using the
166
+ You can optionally pass a state to this action creator to update the state of the
167
+ current route.
168
+
169
+ The ` avoidRouterUpdate ` , if ` true ` , will stop react-router from reacting
170
+ to this URL change. This is useful if replaying snapshots while using the
167
171
` forceRefresh ` option of the browser history which forces full
168
172
reloads. It's a rare edge case.
173
+
174
+ ### ` replacePath(path, state, { avoidRouterUpdate = false } = {}) `
175
+
176
+ An action creator that you can use to replace the current URL without updating
177
+ the browser history.
178
+
179
+ The ` state ` and the ` avoidRouterUpdate ` parameters work just like ` pushPath ` .
0 commit comments