Skip to main content
Version: Next

Usage With Redux Toolkit

Setup#

import { configureStore } from '@reduxjs/toolkit'
import yourReducer1 from './yourReducer1'
import yourReducer2 from './yourReducer2'
import {
setConfig,
mergeReducers,
SET_REDUX_STATE,
SUBSCRIBE_REDUX_STATE
} from 'use-redux-states'
const appReducer = mergeReducers({ yourReducer1, yourReducer2 })
const store = configureStore({
appReducer,
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: {
ignoredActions: [SET_REDUX_STATE, SUBSCRIBE_REDUX_STATE]
}
})
})
setConfig({cleanup: false})