Conversation
Minkyu0424
reviewed
Feb 5, 2025
|
|
||
| const { data } = useQuery<StatisticsData[]>({ | ||
| queryKey: [statisticsType, periodType], | ||
| queryKey: computed(() => [statisticsType, periodType]), |
Contributor
There was a problem hiding this comment.
기존의 경우엔 statisticsType, periodType이 바뀌어도 새로운 요청이 가지 않는건가요?
Contributor
Author
There was a problem hiding this comment.
StatisticsCard의 경우 사실 기존의 코드도 정상적으로 작동했습니다.
statisticsType의 경우 애초에 변하지 않으며 periodType는 변해도 일단은 정상적으로 작동했지만,
StatisticsCategoryCard에서 해당 부분에서 변화를 감지하지 못 해 문제가 생겼다보니,
이후 혹시 모를 오작동에 대비해 동일하게 computed로 감싸주게 되었습니다.
비효율적일 수도 있지만, computed를 하나 사용하여 떨어지는 성능보다
혹시 모를 오작동을 사전에 방지하는 것이 더 큰 return 이라고 생각하여 함께 추가해두었습니다.
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.
#️⃣연관된 티켓 넘버
📝작업 내용
🏞️스크린샷 (선택)
💬리뷰 요구사항(선택)