Merge pull request #166 from ZauberNerd/fix-non-serializable-error
Fix non-serializable error messagemain
commit
4f5e7fbdc8
|
@ -1,11 +1,20 @@
|
||||||
import { configureStore } from '@reduxjs/toolkit';
|
import { configureStore } from '@reduxjs/toolkit';
|
||||||
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
||||||
|
import {
|
||||||
|
FLUSH,
|
||||||
|
PAUSE,
|
||||||
|
PERSIST,
|
||||||
|
PURGE,
|
||||||
|
REGISTER,
|
||||||
|
REHYDRATE,
|
||||||
|
persistReducer,
|
||||||
|
persistStore,
|
||||||
|
} from "redux-persist";
|
||||||
import storage from 'redux-persist/lib/storage';
|
import storage from 'redux-persist/lib/storage';
|
||||||
import { persistReducer, persistStore } from 'redux-persist';
|
|
||||||
import messageReducer from './message';
|
import messageReducer from './message';
|
||||||
import uiReducer from './ui';
|
|
||||||
import settingsUIReducer from './settings-ui';
|
import settingsUIReducer from './settings-ui';
|
||||||
import sidebarReducer from './sidebar';
|
import sidebarReducer from './sidebar';
|
||||||
|
import uiReducer from './ui';
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'root',
|
key: 'root',
|
||||||
|
@ -26,12 +35,18 @@ const persistMessageConfig = {
|
||||||
|
|
||||||
const store = configureStore({
|
const store = configureStore({
|
||||||
reducer: {
|
reducer: {
|
||||||
message: persistReducer(persistMessageConfig, messageReducer),
|
message: persistReducer<ReturnType<typeof messageReducer>>(persistMessageConfig, messageReducer),
|
||||||
ui: uiReducer,
|
ui: uiReducer,
|
||||||
settingsUI: settingsUIReducer,
|
settingsUI: settingsUIReducer,
|
||||||
sidebar: persistReducer(persistSidebarConfig, sidebarReducer),
|
sidebar: persistReducer<ReturnType<typeof sidebarReducer>>(persistSidebarConfig, sidebarReducer),
|
||||||
},
|
},
|
||||||
})
|
middleware: (getDefaultMiddleware) =>
|
||||||
|
getDefaultMiddleware({
|
||||||
|
serializableCheck: {
|
||||||
|
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
export type RootState = ReturnType<typeof store.getState>;
|
export type RootState = ReturnType<typeof store.getState>;
|
||||||
export type AppDispatch = typeof store.dispatch;
|
export type AppDispatch = typeof store.dispatch;
|
||||||
|
|
Loading…
Reference in New Issue