Angular - State Management
Identify the error in this NgRx reducer code:
function todoReducer(state = [], action) {
if (action.type === 'add') {
state.push(action.payload);
return state;
}
return state;
}