Skip to content

Instantly share code, notes, and snippets.

@johnmarinelli
Created April 28, 2018 15:42
Show Gist options
  • Save johnmarinelli/be5c29fde224a2fb0901f52281ce43fb to your computer and use it in GitHub Desktop.
Save johnmarinelli/be5c29fde224a2fb0901f52281ce43fb to your computer and use it in GitHub Desktop.
redux persist config
const persistConfig = {
key: 'root',
storage,
whitelist: ['user', 'BrowseScreen', 'wikiArt'],
}
const persistedReducer = persistReducer(persistConfig, AppReducer)
this.store = Reactotron.createStore(
persistedReducer,
composeWithDevTools(applyMiddleware(...middlewares))
)
this.persistor = persistStore(this.store)
const AppReducer = combineReducers({
wikiArt: WikiArtReducer,
BrowseScreen: BrowseReducer,
user: UserReducer,
})
export default AppReducer
const defaultState = {
cardIndex: 0,
paintingsPool: []
}
const persistConfig = {
key: 'BrowseScreen',
storage,
blacklist: ['paintingsPool']
}
export default persistReducer(persistConfig, browseReducer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment