인프런 커뮤니티 질문&답변
질문이여
해결된 질문
작성
·
140
0
리덕스 사가에서여,
function* signUp(action){
try{
yield call(signUpAPI, action.data);
yield put({
type: SIGN_UP_SUCCESS
})
}catch(e){
yield put({
type:SIGN_UP_FAILURE,
error:e,
})
}
}
이 부분이요 ,,
제가 ,
export const signUpAction = () =>{ return type: SIGN_UP_SUCCESS }
이거를 다른 파일에서 뽑아서,
function* signUp(action){
try{
yield call(signUpAPI, action.data);
yield put(signUpAction()) // <-에러
}catch(e){
....
}
yield put(signUpAction()) 이 부분에서 이런 에러가 나더라구요.
actions must be plain objects. use custom middleware for async actions
인터넷에 찾아보니까 thunk? 인가를 쓰라고 하던데, 왜 그런거죠... 잘 이해가 안가네요? signUpAction 함수가 비동기가 아니여서 그런건가요 ??





