inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

kok님의 게시글

kok kok

@yfimm12758469

수강평 작성수
2
평균평점
5.0

게시글 1

질문&답변

질문 있습니다.

지금 강의 복습하면서 하는거라서 redux-saga 를 현재 쓰고있는 상태입니다. function myLocationAPI (latLong) { return axios . get ( `https://dapi.kakao.com/v2/local/geo/coord2address.json?x= ${latLong. long } &y= ${latLong. lat } ` , { headers : { "Authorization" : "test" , } , }) ; } function * myLocation (action) { try { const result = yield call ( myLocationAPI , action. data ) ; yield put ({ type : MY_LOCATION_SUCCESS , data : result. data .documents[ 0 ] }) ; } catch (e) { yield put ({ type : MY_LOCATION_FAILURE , error : e , }) ; } } function * watchMyLocation () { yield takeLatest ( MY_LOCATION_REQUEST , myLocation ) ; } const {mainCardPics , myLocation} = useSelector (state => state. user ) ; dispatch({ type : MY_LOCATION_REQUEST , data : { lat : position. coords . latitude , long : position. coords . longitude , } , }) ; console . log ( "dong : " , myLocation) ; dispatch({ type : GET_POSTS_REQUEST , data : { dong : myLocation. dong , } , }) ; dispatch 액션이 끝나면 myLocation 에 결과 값이 담겨야 되지 않나요? 근데 위와 같이 하면 빈 객체가 콘솔에 나와서요

좋아요수
0
댓글수
3
조회수
216