Created
April 28, 2018 15:42
-
-
Save johnmarinelli/be5c29fde224a2fb0901f52281ce43fb to your computer and use it in GitHub Desktop.
redux persist config
This file contains hidden or 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
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) |
This file contains hidden or 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
const AppReducer = combineReducers({ | |
wikiArt: WikiArtReducer, | |
BrowseScreen: BrowseReducer, | |
user: UserReducer, | |
}) | |
export default AppReducer |
This file contains hidden or 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
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