Serializability Middleware
A custom middleware that detects if any non-serializable values have been included in state or dispatched actions, modeled after redux-immutable-state-invariant
. Any detected non-serializable values will be logged to the console.
This middleware is added to the store by default by configureStore
and getDefaultMiddleware
.
You can customize the behavior of this middleware by passing any of the supported options as the serializableCheck
value for getDefaultMiddleware
.
Options
Exports
createSerializableStateInvariantMiddleware
Creates an instance of the serializability check middleware, with the given options.
You will most likely not need to call this yourself, as getDefaultMiddleware
already does so.
Example:
- TypeScript
- JavaScript
isPlain
Checks whether the given value is considered a "plain value" or not.
Currently implemented as:
- TypeScript
- JavaScript
This will accept all standard JS objects, arrays, and primitives, but return false for Date
s, Map
s, and other similar class instances.