리덕스를 사용하면 컴포넌트들의 상태 관련 로직들을 다른 파일들로 분리시켜 효율적으로 관리할 수 있다.
리덕스는 Action(액션), reducer(리듀서), Store(스토어)으로 이루어져 있다.

{
	type: 'STUDY_REDUX',
    data: {
    	id: 1,
        text: '리덕스 공부하기'
    }
}
function studyRedux(data) {
	return{
    	type: 'STUDY_REDUX',
        data
    }
}
화살표 함수로도 만들 수 있다!
const studyRedux = data => ({
	type: 'STUDY_REDUX',
    data
})
const initialState = {
	counter = 1;
}
function reducer(state = initialState, action) {
	switch(action.type) {
    	case INCREMENT:
        	return {
            	counter: state.counter + 1
            };
            default:
            	return state;
    }
}
dispatch(action)
const listener = () => {
	console.log('상태 업데이트');
}
const unsubscribe = store.subscribe(listener);
unsubscribe();