Skip to content
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

[FE] feat: 리뷰 좋아요 디바운스 적용 #377

Merged
merged 4 commits into from
Aug 10, 2023
Merged

Conversation

Leejin-Yang
Copy link
Collaborator

Issue

✨ 구현한 기능

  • 리뷰 좋아요 리액트 쿼리로 마이그레이션
  • 리뷰 좋아요 디바운스 적용

📢 논의하고 싶은 내용

  • useDebounce 훅을 만들어봤는데 리뷰해주십쇼.!

🎸 기타

x

⏰ 일정

  • 추정 시간 : 4시간
  • 걸린 시간 : 2시간

Copy link
Collaborator

@hae-on hae-on left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고했어요 이제 좋아요를 갈겨도 문제 없겠군요 😏

Copy link
Collaborator

@xodms0309 xodms0309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다~~ 코멘트 읽어주세요~!

@@ -0,0 +1,35 @@
import { useCallback, useEffect, useRef } from 'react';

// eslint-disable-next-line @typescript-eslint/ban-types
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 뭔가요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function 타입을 쓸 수 없어서 임의로 했읍니다..
린트 설정에 추가할까요?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

린트 설정 추가하면 좋을 것 같아요!

Comment on lines +28 to +30
useEffect(() => {
return clear;
}, []);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear만 따로 useEffect 선언해주는 이유는 뭔가요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

언마운트 될 때 타임아웃 클리어 하기 위해 작성했읍니다!

return clear;
}, []);

return [debounce, clear];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

순서 걱정 없는 객체로 리턴하는건 어떤가요?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

쓰는 곳에서 자유롭게 이름을 수정하기 위해 작성했습니다
{debounce: debouncedToggleFavorite} 이 형태가 너무 길어질거 같아서요

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅋㅋㅋㅋㅋ 알겠습니다

@github-actions
Copy link

Unit Test Results

2 tests   2 ✔️  5s ⏱️
1 suites  0 💤
1 files    0

Results for commit e8f2527.

@Leejin-Yang
Copy link
Collaborator Author

@xodms0309

린트 설정 수정했습니다 😊

Copy link
Collaborator

@xodms0309 xodms0309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨슴다~!~!!!

@Leejin-Yang Leejin-Yang merged commit 9293ba2 into develop Aug 10, 2023
3 checks passed
@Leejin-Yang Leejin-Yang deleted the feat/issue-353 branch August 10, 2023 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FE] 리뷰 좋아요 디바운스 적용
3 participants