Perimisi mau bertanya tentang reducer
const reducer = (state = initialState, action) => {
switch (action.type) {
case 'INCREMENT':
return {
...state,
initialState.number + action.payload;
}
case 'DECREMENT':
return {
...state,
initialState.number - action.payload;
}
default:
return state;
}
};
yang di dalam case kenapa ada return …state? mengapa tidak langsung return gini aja
“initialState.number - action.payload”