I'm using Redux Promise Middleware and my action creator returns an action with a promise.
Now, in the reducer, I receive the resolved promise data and I have to 'provide' the new state. I also have to do something that is not 'pure' with that data, e.g., store it in local storage.
How should I approach this situation and still keep the reducer pure? That data is obtained in middleware and the first time I get it is in reducer.
I know I can handle the promise in my action creator and access the data before dispatching the action but is there another better way?
redux-observable
/redux-saga
are middlewares to take care of this. – Balázs Édes