fix persisting error eventTypeReducer

This commit is contained in:
Sasha Pierson 2018-01-04 17:43:28 -08:00
Родитель 02a0d161f9
Коммит 26cf81d39e
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -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