yarn @reduxjs/toolkit 1.2.3

latest releases: 2.2.6, 2.2.5, 2.2.4...
4 years ago

This release adds an option to the serializability-check middleware to allow ignoring specific state paths.

Changes

Allow Skipping Serializability Checks for State Paths

The redux-immutable-state-invariant middleware has an option for skipping checks for selected slices of state: https://github.com/leoasis/redux-immutable-state-invariant#api . However, our homegrown serializable-state-invariant middleware only allowed determining if a given value is serializable, and skipping specific actions, not skipping slices of state.

We've now added a ignoredPaths option to the serializability middleware that will force it to skip serializability checks for dot-separated keypaths within the state, like:

const store = configureStore({
    reducer: rootReducer,
    middleware: getDefaultMiddleware({
        serializabilityCheck: {
            ignoredPaths: ["testSlice.a", "testSlice.b.c"]
        }
    })
})

Note that we strongly advise against ever putting non-serializable values into the store state. This option is meant only as an escape hatch, such as working around libraries that do that anyway.

Changelog

v1.2.2...v1.2.3

Don't miss a new toolkit release

NewReleases is sending notifications on new releases.