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: