I've created a redux middleware used for calling my API.
For better debugging I've also implemented status for each of the objects in my state.
Now I have to do this in every case of all reducers:
case SET_USER:
return {
...state,
workspaces: action.response.data.workspaces,
status: action.status, <--
}
Which is pretty repetetive. Is there any way I can change the state (at the correct place) each time automatically?
I do have access to the action type, maybe I could use that somehow?