Skip to content

Instantly share code, notes, and snippets.

@GuilhermeLis
Created November 20, 2020 14:13
Show Gist options
  • Save GuilhermeLis/a7b35a73ef8f874efa740d2e6f522dcb to your computer and use it in GitHub Desktop.
Save GuilhermeLis/a7b35a73ef8f874efa740d2e6f522dcb to your computer and use it in GitHub Desktop.
persistReducers from Redux with AsyncStorage
import AsyncStorage from '@react-native-async-storage/async-storage';
import { persistReducer } from 'redux-persist';
export default (reducers: any) => {
const persistedReducer = persistReducer(
{
key: 'redux-with-asyncstorage',
storage: AsyncStorage,
blacklist: [],
},
reducers,
);
return persistedReducer;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment