зеркало из https://github.com/Azure/Sia-EventUI.git
fix persisting error eventTypeReducer
This commit is contained in:
Родитель
02a0d161f9
Коммит
26cf81d39e
|
@ -1,8 +1,9 @@
|
|||
import { combineReducers } from 'redux'
|
||||
import * as eventTypeActions from '../actions/eventTypeActions'
|
||||
import { mergeToStateById } from './reducerHelpers/merge'
|
||||
import buildFetching from './reducerHelpers/fetching'
|
||||
import buildError from './reducerHelpers/error'
|
||||
import { persistCombineReducers } from 'redux-persist'
|
||||
import { persistReducer } from 'redux-persist'
|
||||
import storage from 'redux-persist/lib/storage' // default: localStorage if web, AsyncStorage if react-native
|
||||
|
||||
const persistConfig = {
|
||||
|
@ -33,10 +34,12 @@ export const records = (state = defaultEventTypeCollection, action) => {
|
|||
}
|
||||
}
|
||||
|
||||
export const eventTypeReducer = persistCombineReducers(persistConfig, {
|
||||
const persistedRecords = persistReducer(persistConfig, records)
|
||||
|
||||
export const eventTypeReducer = combineReducers({
|
||||
fetching,
|
||||
error,
|
||||
records
|
||||
records: persistedRecords
|
||||
})
|
||||
|
||||
export default eventTypeReducer
|
||||
export default eventTypeReducer
|
Загрузка…
Ссылка в новой задаче