-
Notifications
You must be signed in to change notification settings - Fork 0
[URH-42] useDetectInactivity 신규 #36
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
멋진 훅입니다👍 고생하셨습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨어요 소현 님!👍🏻✨
src/hooks/useDetectInactivity.ts
Outdated
export default useDetectInactivity; | ||
|
||
export const isTouchDevice = () => { | ||
if (typeof window === 'undefined') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P4] isClient 유틸 함수를 만들어도 좋겠네요! 저도 사용하고 있고, 추후에 자주 사용될 것 같아서요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bicochan isClient와 isTouchDevice 둘다 유틸로 분리하는 방향이 좋을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isClient같은 부분은 저도 많이 사용하는 함수여서 먼저 제 작업 브랜치에서 utils로 분리했어요! 다음 PR에 반영하겠습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeongbaebang 앗 반영하고 돌아오니 답변이 달렸었네요..아무튼 isTouchDevice도 일단은 활용성이 있어보여서 분리하고 나중에 더 쓰일일이 없다면 합치는걸로 하겠습니다
👾 Pull Request
1️⃣ Spec
2️⃣ 변경 사항
3️⃣ 예시 코드
1. 반환값이 없는 경우
2. 반환값이 있는 경우
4️⃣ 관련 문서 (선택 사항)
+)
isTouchDevice
라는 함수를 작성해서 현재 상태가 터치기능을 지원하는지 판단하여 상태에따라 등록되는 이벤트를 분리할 수 있도록 했는데, 이 함수가 다른 훅에서도 쓰일 가능성이 있다면 util안으로 분리하고 싶습니다.