personally i don't think that's necessary - if REQUEST_STARTED is fired multiple times when it is already loading, I would think there are more serious problems in other parts of the app, not just in the reducer.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
case REQUEST_STARTED:
// Avoid updating state unnecessarily
// By returning unchanged state React won't re-render
if (state.isLoading) {
return state;
}
return {
...state,
isLoading: true,
};
Hi - thanks for the comment.
personally i don't think that's necessary - if
REQUEST_STARTED
is fired multiple times when it is already loading, I would think there are more serious problems in other parts of the app, not just in the reducer.