To be able to return the normalized (entities) results in the redux-saga-thunk promise the entities middleware needs to be before the redux-saga-thunk middleware. Otherwise the entities middleware isn't called until after the redux-saga-thunk middle returns results.
Ideally we could add a check that would warn if the middlewares were out of order.
The following code examples are from a project using URM that I updated to get the entities values in promise returned from action request.
Previous (Not Working)
export default [
ReduxSagaThunk,
ReduxThunk,
routerMiddleware(browserHistory),
// NOTE: ^^-- above reducers must be first and in order
// redux-modules
entities,
];
Updated (Working)
export default [
// redux-modules
entities,
// following middleware must be in this order
ReduxSagaThunk,
ReduxThunk,
routerMiddleware(browserHistory),
];
To be able to return the normalized (entities) results in the redux-saga-thunk promise the entities middleware needs to be before the redux-saga-thunk middleware. Otherwise the entities middleware isn't called until after the redux-saga-thunk middle returns results.
Ideally we could add a check that would warn if the middlewares were out of order.
The following code examples are from a project using URM that I updated to get the entities values in promise returned from action request.
Previous (Not Working)
Updated (Working)