Skip to content

Instantly share code, notes, and snippets.

@GuilhermeLis
Created November 20, 2020 14:13
Show Gist options
  • Select an option

  • Save GuilhermeLis/a7b35a73ef8f874efa740d2e6f522dcb to your computer and use it in GitHub Desktop.

Select an option

Save GuilhermeLis/a7b35a73ef8f874efa740d2e6f522dcb to your computer and use it in GitHub Desktop.

Revisions

  1. Guilherme Lisboa created this gist Nov 20, 2020.
    15 changes: 15 additions & 0 deletions persistReducers.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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;
    };