-
Notifications
You must be signed in to change notification settings - Fork 3
✨ Feat: 유저 기능 구현 #43
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
✨ Feat: 유저 기능 구현 #43
Conversation
- store 설정 - userSlice 추가 - app 컴포넌트에서의 Provider 지정
| // useSelector를 사용하여 Redux store의 상태를 조회 | ||
| const { user, error } = useSelector((state: RootState) => state.user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redux store의 상태값 조회 예시
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
설명 친절하게 적어주셔서 감사합니다!!
인증 관련된 작업 할때마다 이 PR 참고할게요~~
전 아직 Redux는 잘 몰라서 그 부분은 리뷰하기 어렵네요ㅠ
| import { persistStore, persistReducer } from 'redux-persist'; | ||
| import storage from 'redux-persist/lib/storage'; | ||
|
|
||
| import userReducer from './reducers/userSlice'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다른곳에서 리덕스 사용할 때 이거처럼 slice 만들고 밑에 reducer에 추가해서 상태 관리하면 되는 건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 맞습니다! 개별 slice를 만들고 store.ts에 있는 reducer에 등록하시면 됩니다 :)
src/store/store.ts
Outdated
| export const store = configureStore({ | ||
| reducer: { | ||
| user: userReducer, | ||
| persistedReducer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
궁금한게 있습니다
위에
const persistedReducer = persistReducer(persistConfig, userReducer);
에서 userReducer를 넣었는데 여기서 다시 안 넣어도 되지 않을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 넵 중복되네요!! 수정해서 다시 커밋 올려놓을게요 감사합니다 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하루만에 만드시느라 고생하셨습니다!
oceanlee-seoul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다...! :) :)
연관된 이슈
작업 내용
useMutation훅을 사용했습니다. mutation 상태(성공, 실패, 로딩 등)를 관리할 수 있습니다.스크린샷
코멘트 및 논의 사항
useSelector를 사용해 Redux store의 상태를 가져올 수 있습니다. 예시clearUser리듀서 사용 2. 로컬스토리지의 accessToken 삭제 방법 중에 선택하시면 됩니다.