Created
May 14, 2021 14:55
-
-
Save benjaminreid/1a1c23fb2df6b635c73f5c5c83e98ad7 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
// reducers setup | |
import AsyncStorage from '@react-native-async-storage/async-storage'; | |
import { persistCombineReducers } from "redux-persist"; | |
const config = { | |
key: STORAGE_PREFIX, | |
debug: ENV === "development", | |
storage: AsyncStorage, | |
}; | |
const reducer = persistCombineReducers(config, { | |
a, b, c, | |
}); | |
// create store | |
import { configureStore } from "@reduxjs/toolkit"; | |
import { persistStore } from "redux-persist"; | |
const store = configureStore({ | |
reducer, | |
middleware: getDefaultMiddleware => | |
getDefaultMiddleware({ | |
thunk: false, | |
serializableCheck: false, | |
immutableCheck: false, | |
}).concat([...]), | |
}); | |
const persistor = persistStore(store); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment