Count reducer
function countReducer ({ count, ...state }, { type, payload }) { | |
switch (type) { | |
case ADD_N: | |
return { ...state, count: count + payload }; | |
case ADD_ONE: | |
return { ...state, count: count + 1 }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment