The state of your whole application is stored in an object tree within a single store.
Maintain our application state in a single object which would be managed by the Redux store.
The only way to change the state is to emit an action, an object describing what happened.
To update the state of your app, you need to let Redux know about that with action.
Not allowed to directly update the state object.
To specify how the state tree is transformed by actions, you write pure reducers.
Reducer function - (previousState, action) => newState
JavaScript App이 있다. 이 App의 State는 Redux Store라는 별도의 공간에서 관리한다.
App은 Redux Store를 구독하고 있다. 그러나 App에서 Redux Store의 state를 직접 업데이트 할 수는 없다.
App이 state를 업데이트 하려면 action을 dispatch(emit) 해야 한다.
action이 dispatch되면 Reducer가 그 action을 처리하여 현재 state를 업데이트 한다.
state가 업데이트되는 즉시 App에 전달된다(subscribe하고 있으므로).
이것이 Redux의 기본 동작 원리이다.