Last active
August 28, 2016 21:26
-
-
Save rt2zz/d1b11137cdc598a7580db361cf3dfb96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createTransform, getStoredState, purgeStoredState } from 'redux-persist' | |
import { autoRehydrate as baseAutoRehydrate, createPersistor as baseCreatePersistor, persistStore as basePersistStore } | |
export { createTransform, getStoredState, purgeStoredState } | |
import immutableConfig from './immutableConfig' // basically verbatim redux-persist-immutable-state but keys renamed: _stateInit, _stateGetter, ... | |
import stateReconciler from './stateReconciler' | |
// perhaps we should add some validation to make sure stateReconciler is not being overriden? | |
export const autoRehydrate = (config, ...args) => { | |
return baseAutoRehydrate({...config, stateReconciler}, ...args) | |
} | |
export const createPersistor = (config, ...args) => { | |
return baseCreatePersistor({...config, ...immutableConfig}, ...args) | |
} | |
export const persistStore = (config, ...args) => { | |
return basePersistStore({...config, ...immutableConfig}, ...args) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment