feat(bingo) bingo 부분에 reactQuery 추가#34
Open
mksoo wants to merge 5 commits into
Open
Conversation
ehddnr301
reviewed
Jul 21, 2024
| }, | ||
| }) => { | ||
| const { userId, boardData } = args; | ||
| return createBingoBoard( |
Contributor
There was a problem hiding this comment.
❓혹시 이부분 광수님 환경에서는 잘 호출되실까요? 동작 테스트 해보려고 하는데 수정된 부분이 호출되지 않는것 같아서요
temp_0722.mov
Contributor
Author
There was a problem hiding this comment.
아하 이 부분은 호출은 됐는데, 저 같은 경우는 CORS나 bingo backend api 부분에서 발생한 이슈 때문에 안되는 것 같더라구요! 저도 좀 더 살펴보고 말씀드릴게요!
Contributor
There was a problem hiding this comment.
아!? 호출이 되는걸 확인하셨군요! 저도 잘못 설정한게 없는지 한번 더 확인해보겠습니다!
Contributor
Author
There was a problem hiding this comment.
네네! 감사합니당 저도 좀 더 봐볼게욥
ehddnr301
reviewed
Jul 28, 2024
Comment on lines
+6
to
+9
| export const useUserByUsername = (username: string) => { | ||
| return useQuery({ | ||
| queryKey: QueryKeyGenerator.user(username), queryFn: () => { | ||
| const data = getUserByUsername(username) |
Contributor
There was a problem hiding this comment.
export const useUserByUsername = async (username: string) => {
return useQuery({
queryKey: QueryKeyGenerator.user(username), queryFn: () => {
const data = await getUserByUsername(username)와 같이 하면 정상적으로 데이터가 가져와집니다.
| const fetchedBingoWords = await getBingoBoard(user.user_id); | ||
| const fetchedSelectedWords = await getSelectedWords(user.user_id); | ||
| setBingoWords(fetchedBingoWords); | ||
| setUserSelectedWords(fetchedSelectedWords); |
Contributor
There was a problem hiding this comment.
이 부분이 사라지면서 �presenter쪽에서 userSelectedWords의 길이가 초기값에서 변하지않아 다음창으로 넘어가지 않는것으로 추정됩니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
크게 바꾼건 다음과 같습니다.
원래 하나만 바꾸려고 하다가 다른 부분들도 연관되어 있기도 하고, 하나만 바꾸면 임팩스가 적어 보여서 약간 조금 더 바꿔봤습니다.
제가 생각했을 떄, 이번 변경에서 reactQuery가 효과를 본 부분은 onRefresh 하는 부분이랑 mutation(create, delete, update 등)을 했을 때 invalidateQuery를 돌리면서 자동으로 상태가 변경된다는 점입니다.(근데 제가 이걸 테스트해보려고 이런저런 방법을 써봤는데, 히스토리를 제가 모르는 부분도 있기도 해서, 재현은 못해봤어요.ㅠ 근데 아마 여러모로 편할 거라고 생각됩니다. 무한 스크롤도 쉽게 구현가능하기도 하고.. 등등?)
어쩃든 검토해보고 도입여부 알려주시면 좋겠습니당.(아니면 저라도 사용해도 괜찮으시다면...ㅎ 빌더,러너 지원 시스템 구축이 조금 더 편해질 것 같네용..! 하핫)
((여담으로 admin은 react admin 라이브러리 쓰면 좋을 것 같다는 추신과 함께... 마무리 하겠읍니다.))