Docker -> use old storage statements
parent
1ba3a8117b
commit
87c9ec632d
|
|
@ -10,14 +10,9 @@ import { userAuthReducer } from './slices/userAuthSlice'
|
|||
import { userCrudReducer } from './slices/userCrudSlice'
|
||||
|
||||
|
||||
let persistedState = null
|
||||
let persistedState = loadState()
|
||||
|
||||
if (typeof window !== `undefined`) {
|
||||
persistedState = loadState()
|
||||
}
|
||||
|
||||
export const store = typeof window !== `undefined`
|
||||
? configureStore({
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
modelCrudReducer,
|
||||
renderCrudReducer,
|
||||
|
|
@ -26,17 +21,12 @@ export const store = typeof window !== `undefined`
|
|||
userCrudReducer
|
||||
},
|
||||
preloadedState: persistedState
|
||||
})
|
||||
: 0
|
||||
})
|
||||
|
||||
if (typeof window !== `undefined`) {
|
||||
|
||||
store.subscribe(() => {
|
||||
store.subscribe(() => {
|
||||
saveState(store.getState());
|
||||
});
|
||||
});
|
||||
|
||||
store.subscribe(lodash.throttle(() => {
|
||||
store.subscribe(lodash.throttle(() => {
|
||||
saveState(store.getState())
|
||||
}, 100))
|
||||
|
||||
}
|
||||
}, 100))
|
||||
|
|
|
|||
Loading…
Reference in New Issue