Skip to content

✨ feat: useDelayFlag 생성 #5

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

Merged
merged 5 commits into from
Jul 9, 2024
Merged

Conversation

bicochan
Copy link
Member

@bicochan bicochan commented Jul 6, 2024

👾 Pull Request

  • 작업명: useDelayFlag
  • 상태: 신규

Spec

  • 인자로 받은 플래그(페칭 또는 로딩)를 일정 시간 이상 지연시킵니다.
  • 데이터 페칭 시간이 0.1초만에 종료될 경우 사용자에게 로딩 UI를 보여주면 플리커 현상이 발생하는데, 이를 개선할 수 있는 훅입니다.
  • 이 훅을 통해 반환된 플래그는 기본적으로 1초(1000ms)간 지속됩니다.

예시 코드

const isDelayLoading = useDelayFlag(isLoading);
// or
const isTwoSecondDelayLoading = useDelayFlag(isLoading, 2000);

@bicochan bicochan self-assigned this Jul 6, 2024
Copy link
Member

@jeongbaebang jeongbaebang 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

@foresec foresec left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 쓰임새가 확실한 훅이네요👍

@bicochan bicochan merged commit ad3761a into master Jul 9, 2024
@bicochan bicochan deleted the feature/use-loading-flag branch July 9, 2024 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants