robwalkerco / redux-persist-filesystem-storage

Redux persist adaptor for React Native filesystem storage
MIT License
196 stars 71 forks source link

How to configure with redux-offline #50

Closed zommerberg closed 4 years ago

zommerberg commented 4 years ago

Hello, I need to persist medium amount of data locally on the phone with redux so I found this package, however I don't understand how to set it up together with redux-offline. My setup is:

let rehydrated = false;

export const getHydrationState = () => rehydrated;

const setHydratedState = () => store.dispatch(setHydrated());

const store = createStore(
  rootReducer,
  compose(
    offline({
      ...offlineConfig,
      persistOptions: {
        blacklist: ['hydration'],
      },
      persistCallback: () => {
        setLanguage();
        setHydratedState();
      },
      retry: () => 300000, // retry  every 5 minutes
    }),
    applyMiddleware(thunk),
  ),
);

export default store;

Does anyone has an idea how to set it up? Thanks!

zommerberg commented 4 years ago

Got it answered here : #26