Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: crews에 대한 설명 추가 완료 #5 #7

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions devears-front/src/data/crew/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down