[Feat/#188]: 프로필 피드 아이템 삭제 #189
Merged
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.
📍 작업 내용
📍 구현 결과 (선택)
📍 기타 사항
메모, 리뷰 상세 페이지에서 각각 조건에 맞는 바텀시트를 보여주기 위해 지민님이 구현하신 useCustomeRouter의 navigate를
전역 상태를 이용해 상태값도 같이 전달할 수 있게 구현했습니다.
url의 쿼리스트링에 정보를 추가해 처리할까 했지만 상세 페이지 내부에서 탭을 변환할때 url이 초기화 되는 이슈가 있어 전역 상태를 이용했습니다.
추가적으로 피드 아이템 삭제를 구현하면서 우물 아이템 삭제 로직을 참고했는데요,
해당 로직을 참고하면서 메모 상세 페이지 데이터를 가져오는데 staleTime이 0으로 설정된걸 확인했습니다.
20초로 기본 설정되어 있기 때문에 최신화를 위해서 0으로 설정하신거라고 생각이 드는데,
이 로직을 invalidate.Queries를 이용해서 업데이트가 발생한 경우에만 다시 패치하는게 어떨까 생각이 듭니다.
invalidate.Queries를 사용할 경우 더 디테일한 조작이 가능하고, 사용자 액션으로 인해 최신화 되는 경우가 아니라면
캐싱된 데이터를 재사용 해도 된다고 생각하고, staleTime:0으로 인해 반복해서 요청되는 불필요한 네트워크 요청을 줄일 수 있다고 생각합니다.
더불어 불필요한 네트워크 요청을 줄이는건 비용 감소에도 효율적이라고 생각합니다.
지민님 의견 부탁드립니다 !