v2.8.4
New serializeState and serializeAction parameters
- serializeState (boolean or function or object) - specify how and what should be handled during serialization (useful if state is not plain object). Could be:
-
false- handle only circular references. -
true- handle also dates, regexes, undefined, error objects, and functions. -
function(key, value)- JSON replacer. Example of usage with mori data structures:const store = Redux.createStore(reducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__({ serializeState: (key, value) => ( value && mori.isMap(value) ? mori.toJs(value) : value ) }));
-
object (
{ replacer: function, options: object }) - in addition to the replacer function, specify an options object, which containsdate,regexe,undefined,error, andfunctionkeys. Fo each of them you can indicate whether to include (if set astrue). Forfunctionkey you can also specify a custom function which handles serialization. Seejsanfor more details. Example:const store = Redux.createStore(reducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__({ serializeState: { options: { undefined: true, function: function(fn) { return fn.toString() } } } }));
-
- serializeAction (boolean or function or object) - same as
serializeStatebut used for actions payloads.
Misc
- Removed support for
serializeoption. Data is always stringified now as the benchmark showd there's no performance gain without serialization. - Deprecated
devToolsExtension.updateStore. Remove it and just use__REDUX_DEVTOOLS_EXTENSION_COMPOSE__instead of the extension's store enhancer. - Fix regression issue from
v2.8.2(#208).