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
Allow consumer to augment middleware to tolerate certain structures (e.g. Immutable) (#141)
* Allow consumer to augment middleware using create options:
- `isSerializable` function should be used for action and state
- Add `getEntries` function to options that can be used to retrieve nested values
- Modify findNonSerializableValue to use `getEntries` or `Object.entries` to find nested values.
* Update docs
* immutable import in example
Copy file name to clipboardExpand all lines: docs/api/otherExports.md
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -15,20 +15,28 @@ Redux Starter Kit exports some of its internal utilities, and re-exports additio
15
15
16
16
Creates an instance of the `serializable-state-invariant` middleware described in [`getDefaultMiddleware`](./getDefaultMiddleware.md).
17
17
18
-
Accepts an options object with an `isSerializable` parameter, which will be used
19
-
to determine if a value is considered serializable or not. If not provided, this
20
-
defaults to `isPlain`.
18
+
Accepts an options object with `isSerializable` and `getEntries` parameters. The former, `isSerializable`, will be used to determine if a value is considered serializable or not. If not provided, this defaults to `isPlain`. The latter, `getEntries`, will be used to retrieve nested values. If not provided, `Object.entries` will be used by default.
21
19
22
20
Example:
23
21
24
22
```js
23
+
import { Iterable } from'immutable';
25
24
import {
26
25
configureStore,
27
-
createSerializableStateInvariantMiddleware
26
+
createSerializableStateInvariantMiddleware,
27
+
isPlain
28
28
} from'redux-starter-kit'
29
29
30
+
// Augment middleware to consider Immutable.JS iterables serializable
0 commit comments