πŸ“š Reference


πŸ”– Index


Reducer


function reducer(state, action) {
  // μƒνƒœ μ—…λ°μ΄νŠΈ 둜직
  return alteredState;
}
function counter(state, action) {
  switch (action.type) {
    case 'INCREASE':
      return state + 1;
    case 'DECREASE':
      return state - 1;
    default:
      return state;
  }
}