I have a background upload process in my react/redux application that updates very frequently. My reducer looks something like this:
export default function progressReducer(state = initialState, action = {}) {
switch (action.type) {
case PROGRESS_TOTAL_INCREASE:
return Object.assign({}, state, {total: state.total + action.amount});
case PROGRESS_CURRENT_INCREASE:
let current = state.current + action.amount, total = state.total;
if (current >= state.total && false) {
state.total = 0;
current = 0;
}
return {total, current};
default:
return state;
}
}
It works. Great. But the redux devtool log fills up very quickly with progress actions, drowning out any other actions. Is this the right approach, or should I be looking at a different way of creating these notifications?
Thanks!