global flow

Context와 reducer 전역 상태는 action이 Provider를 거쳐 화면으로 돌아온다

하위 컴포넌트는 dispatch만 호출하고, Provider 내부 reducer가 state를 바꾼 뒤 consumer들이 새 값을 읽는다.

Consumer dispatch(action) 변경 요청
Provider reducer 실행 next state 계산
Context value state/dispatch 갱신 구독자 알림
UI 새 state 읽기 화면 반영
부분
책임
주의
consumer
의도 전달
state 직접 변경
reducer
순수 계산
부수효과 금지
Provider
value 공급
큰 객체 혼합
effect
저장소 동기화
reducer 안에서 처리 금지
핵심 전역 상태 흐름은 dispatch가 위로 올라가고 계산된 state가 다시 아래로 내려오는 구조다.