You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,11 +25,11 @@ Create a store with `initialState` set to an instance of [`Immutable.Iterable`](
25
25
26
26
```js
27
27
import {
28
-
combineReducers
28
+
combineReducers
29
29
} from'redux-immutable';
30
30
31
31
import {
32
-
createStore
32
+
createStore
33
33
} from'redux';
34
34
35
35
constinitialState=Immutable.Map();
@@ -44,38 +44,38 @@ const store = createStore(rootReducer, initialState);
44
44
```js
45
45
importImmutablefrom'immutable';
46
46
import {
47
-
LOCATION_CHANGE
47
+
LOCATION_CHANGE
48
48
} from'react-router-redux';
49
49
50
50
constinitialState=Immutable.fromJS({
51
-
locationBeforeTransitions:null
51
+
locationBeforeTransitions:null
52
52
});
53
53
54
54
exportdefault (state=initialState, action) => {
55
-
if (action.type===LOCATION_CHANGE) {
56
-
returnstate.merge({
57
-
locationBeforeTransitions:action.payload
58
-
});
59
-
}
55
+
if (action.type===LOCATION_CHANGE) {
56
+
returnstate.merge({
57
+
locationBeforeTransitions:action.payload
58
+
});
59
+
}
60
60
61
-
return state;
61
+
return state;
62
62
};
63
63
```
64
64
65
65
Pass a selector to access the payload state and convert it to a JavaScript object via the [`selectLocationState` option on `syncHistoryWithStore`](https://github.com/reactjs/react-router-redux/tree/v4.0.2#history--synchistorywithstorehistory-store-options):
0 commit comments