Angular - State Management
Given this reducer snippet:
What will be the state after dispatching
const initialState = { count: 0 };
function counterReducer(state = initialState, action) {
switch(action.type) {
case 'increment':
return { count: state.count + 1 };
case 'decrement':
return { count: state.count - 1 };
default:
return state;
}
}What will be the state after dispatching
{ type: 'increment' } twice starting from initial state?