redux-storage with redux-saga - not saving

Viewed 917

I am trying to use both the redux-storage and redux-saga middleware for redux. Each middleware works great on its own, but when I apply redux-storage with redux-saga, the store does not load the prior state. I am adding the middleware as follows:

const combinedReducers = storage.reducer(combineReducers(reducers));
import createEngine from 'redux-storage-engine-reactnativeasyncstorage';
const engine = createEngine('storage-key');
const storageMiddleWare = storage.createMiddleware(engine);
const sagaMiddleWare = createSagaMiddleware(mySagas); 
export const store  = createStore(combinedReducers, applyMiddleware( sagaMiddleWare, storageMiddleWare)); 
 const load = storage.createLoader(engine);
 load(store).then(() => 
    {   
        console.log("Loaded State");
        console.log(store.getState());

    }).done();
2 Answers
Related