Thief of Wealth
Published 2020. 9. 4. 15:13
[Redux] dispatch란? 개발/Web Programming

앞서 포스팅했었지만 다시 복습을 위해서 redux에 대해서 다시 정리한다.

 

redux는 어플리케이션의 클라이언트 쪽 state를 관리하기 위한 이벤트루프이다.

 

action === event

reducer === response of event

 

 

redux는 클라이언트 앱의 복ㅈ바성을 제어하기 위한 하나의 state제어 수단이다. (방법론)

즉 redux는 클라이언트의 종합적인 state를 관리하기 위한 아키텍쳐 방법론이다.

 

redux의 어플리케이션 전체에는 store라는 커다란 하나의 state가 존재하고, 이것이 어플리케이션의 state를 총괄한다.

이 state는 reducer로만 새로운 형태로 바꾸는 것이 가능하다.

 

reducer는 type과 payload를 속성으로 같는 단순 객체인 action 이벤트가 발생했을때에만 작동하고,

action이벤트를 발생시키는 방법은 dispatch 라는 함수에 단순 객체인 action을 넣는 것으로 할 수 있다.

 

dispatch(action) => reducer동작 => store의 state변경 => 변경된 state가 state를 subscription하고 있는 component에 정보전달.

 

 

'개발 > Web Programming' 카테고리의 다른 글

DOM 이란 무엇인가?  (0) 2020.09.09
React Hook 재정리  (0) 2020.09.07
[React] withRouter vs useHistory,useParams,useLocation  (0) 2020.09.04
[CSS]object-fit 속성에 대하여  (0) 2020.09.04
[React] BrowserRouter 란?  (0) 2020.09.04
profile on loading

Loading...