-- 훅이 reducer 를 받으면 갱신 규칙을 호출자에게 넘길 수 있다 — 상태 갱신을 쓰는 쪽에서 빼내 컴포넌트가 제 기능에 집중한다 (State Reducer 패턴)
useToggle :: Maybe Reducer -> (State, Dispatch)
useToggle r = useReducer (fromMaybe toggleReducer r) initial
-- 넘긴 reducer 의 반환값이 다음 state — 기본 reducer 를 불러 돌려주면 기본 동작 유지
custom :: Reducer
custom state action = trace (show (state, action)) (toggleReducer state action)