From a0f6c0705597d99334339eb94f0f20a0f22ac5e2 Mon Sep 17 00:00:00 2001 From: junilHwang Date: Mon, 1 Mar 2021 17:52:06 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20crews=EC=97=90=20=EB=8C=80=ED=95=9C=20?= =?UTF-8?q?=EC=84=A4=EB=AA=85=20=EC=B6=94=EA=B0=80=20=EC=99=84=EB=A3=8C=20?= =?UTF-8?q?#5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devears-front/src/data/crew/reducers.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/devears-front/src/data/crew/reducers.ts b/devears-front/src/data/crew/reducers.ts index 15240a5..eb5e4d3 100644 --- a/devears-front/src/data/crew/reducers.ts +++ b/devears-front/src/data/crew/reducers.ts @@ -19,6 +19,19 @@ const initState: CrewState = { }, } +/** + * Crew Reducer 설명 + * saga에서 getCrew를 실행할 때 다음과 같은 action을 사용한다. + * 1. 처음에 가져오기 전: GET_CREWS_LOADING + * 2. 가져온 후: GET_CREWS_SUCCESS + * 3. 실패할 경우: GET_CREWS_FAILURE + * + * 즉, loading => success or failure 가 되는 것이다. + * + * 결과 값은 GET_CREWS.success에 저장된다. + * + * GET_CREWS의 asked, loading, failure에 따라 컴포넌트에서 보여주는 형태를 다르게 해야 한다. + */ export default function crewReducer(state: CrewState = initState, action: CrewAction) { switch (action.type) { case actionTypes.GET_CREWS_LOADING: