๐Ÿ”ฅ Today


  • [ByteDegree]

    • typesafe-actions ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‚ฌ์šฉ์œผ๋กœ ์•ก์…˜ ์ƒ์„ฑํ•จ์ˆ˜์™€ reducer์„ ๋” ๊น”๋”ํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์คŒ
    • createStandardAction์œผ๋กœ as const์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ ๋„ ์‹ค์ œ ๋ฌธ์ž์—ด ๊ฐ’์„ ํƒ€์ž…์œผ๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์คŒ
    • createReducer๋กœ reducer ์ž‘์„ฑ. ๋ฉ”์„œ๋“œ ์ฒด์ด๋‹ ๋ฐฉ์‹๊ณผ object map ๋ฐฉ์‹์ด ์žˆ๋‹ค.


object map ๋ฐฉ์‹
    const counter = createReducer<CounterState, CounterAction>(initialState, {
  [INCREASE]: (state) => ({ count: state.count + 1 }),
  [DECREASE]: (state) => ({ count: state.count - 1 }),
  [INCREASE_BY]: (state, action) => ({ count: state.count + action.payload }),
  });


๋ฉ”์„œ๋“œ ์ฒด์ด๋‹ ๋ฐฉ์‹
const counter = createReducer<CounterState, CounterAction>(initialState)
  .handleAction(INCREASE, (state) => ({ count: state.count + 1 }))
  .handleAction(DECREASE, (state) => ({ count: state.count - 1 }))
  .handleAction(INCREASE_BY, (state, action) => ({
    count: state.count + action.payload,
  }));


๐Ÿ”ฅ To Do


  • [ecommerce-website] โฉ
  • [๋ถ€์ŠคํŠธ์ฝ”์Šค] project B
  • [Algorithm] javaScript ๋งค์ผ 1๋ฌธ์ œ ์ด์ƒ ํ’€๊ธฐ
  • [๋ถ€์ŠคํŠธ์ฝ”์Šค] CS ์ž๋ฃŒ๊ตฌ์กฐ, ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ฐ•์˜


  • [ByteDegree] React 10์ฃผ์ฐจ - TypeScript & React โฉ
    • 10์ฃผ์ฐจ Quiz : ~ 02/01