Skip to content

Instantly share code, notes, and snippets.

@benjaminreid
Created May 14, 2021 14:55
Show Gist options
  • Save benjaminreid/1a1c23fb2df6b635c73f5c5c83e98ad7 to your computer and use it in GitHub Desktop.
Save benjaminreid/1a1c23fb2df6b635c73f5c5c83e98ad7 to your computer and use it in GitHub Desktop.
// 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