typesafe-actions 으로 리덕스 모듈 리팩토링
typesafe-actions 는 리덕스를 사용하는 프로젝트에서 액션 생성 함수와 리듀서를 쉽고 깔끔하게 작성할 수 있게 해주는 라이브러리이다. 더보기 예) 액션 생성 함수 // 액션타입이 'ADD' 인 액션생성 함수, payload 값은 number const add = createStandardAction('ADD')(); add(10); // { type: 'ADD'', payload: number } 프로젝트 설치 $ yarn add typesafe-actions 카운터 리덕스 모듈 리팩토링 src/modules/counter.ts 액션 타입 선언 const INCREASE = 'counter/INCREASE'; const DECREASE = 'counter/DECREASE'; const INCR..