Skip to content

Commit

Permalink
Better documention for immutablejs (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlucool authored and zalmoxisus committed Jan 20, 2017
1 parent 910bb35 commit 6426fc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -89,7 +89,7 @@
typeof window === 'object' &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
// Specify here name, actionsBlacklist, actionsCreators and other options
// Specify extension’s options like here name, actionsBlacklist, actionsCreators or immutablejs support
}) : compose;

const enhancer = composeEnhancers(
Expand Down
13 changes: 12 additions & 1 deletion docs/API/Arguments.md
Expand Up @@ -32,7 +32,6 @@ Use `window.__REDUX_DEVTOOLS_EXTENSION__([config])` or `window.__REDUX_DEVTOOLS_
- `false` - handle only circular references.
- `true` - handle also dates, regexes, undefined, error objects, symbols, and functions.
- object, which contains `date`, `regex`, `undefined`, `error`, and `function` keys. Fo each of them you can indicate whether to include (if set as `true`). For `function` key you can also specify a custom function which handles serialization. See [`jsan`](https://github.com/kolodny/jsan) for more details. Example:

```js
const store = Redux.createStore(reducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__({
serialize: {
Expand All @@ -43,6 +42,18 @@ Use `window.__REDUX_DEVTOOLS_EXTENSION__([config])` or `window.__REDUX_DEVTOOLS_
}
}));
```
- **immutable** `object`: Automatically serialize/deserialize immutablejs via [remotedev-serialize](https://github.com/zalmoxisus/remotedev-serialize)
```js
import Immutable from 'immutable'; // https://facebook.github.io/immutable-js/
// ...
// Like above, only showing off compose this time. Reminder you might not want this in prod.
const composeEnhancers = typeof window === 'object' && typeof window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ !== 'undefined' ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
serialize: {
immutable: Immutable
}
}) : compose;
```

Example of usage with mori data structures:
```js
Expand Down

0 comments on commit 6426fc5

Please sign in to comment.