Skip to content

Commit 0275aad

Browse files
authored
Update README.md
1 parent fb55339 commit 0275aad

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,22 @@ Returns the current user if exists
124124
### deleteUser : Promise
125125
Deletes the current user from the storage/cookies
126126

127+
## Immutable JS
128+
Usage of `redux-react-session` with an immutable store is really simple.
129+
Instead of the `sessionReducer` import the `sessionImmutableReducer`, as the following example:
130+
131+
- Add the session reducer:
132+
```javascript
133+
import { combineReducers } from 'redux';
134+
import { sessionImmutableReducer as session } from 'redux-react-session';
135+
136+
const reducers = {
137+
// ... your other reducers here ...
138+
session
139+
};
140+
const reducer = combineReducers(reducers);
141+
```
142+
127143
## Server Rendering
128144
`redux-react-session` also provides methods to keep the session with server rendering using cookies. So the session will work on the server side as well as the client side.
129145

0 commit comments

Comments
 (0)