Redux-Promise says: If it receives a promise, it will dispatch the resolved value of the promise. It will not dispatch anything if the promise rejects.
but when I run the code below and do something intentionally to get the promise rejected in action create later I get that rejected promise on reducer too! shouldn't it be NOT sent to the reducer? PLEASE do NOT tell me just the workaround but also tell me why it is happening when Redux-Promise says so.
action:
const responce = axios.get(API_URL);
console.log(responce);
return (
{
type: FETCH_WEATHER,
payload: responce,
}
);
reducer:
export default (state = initalState, action) => {
switch (action.type) {
case FETCH_WEATHER:
console.log(action.payload);
return (
[action.payload.data, ...state]
);
default: return (state);
}
}
the action.payload ^ is:


Repeating the phrasing:
So, there's two different ways to use this middleware:
The "will not dispatch anything if the promise rejects" phrase refers to the first usage - passing a promise directly to
dispatch(). You're using it the second way - passing a promise as a payload.