-
Notifications
You must be signed in to change notification settings - Fork 2
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
스페이스에서 실시간 커서 공유 구현 #155
스페이스에서 실시간 커서 공유 구현 #155
Conversation
5096857
to
8dcf854
Compare
{ name: "여덟", urlPath: "8" }, | ||
{ name: "아홉", urlPath: "9" }, | ||
{ | ||
name: "엄청 긴 제목을 가진 스페이스다아아아아아아아아아아아아아", |
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.
아ㅏㅏㅏㅏㅏㅏㅏㅏㅏㅏ
if (position) { | ||
tween({ ...position }); | ||
} | ||
|
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.
(1점) 사이드 이펙트가 생길 가능성을 고려하면 useEffect
로 감싸도 괜찮을 것 같습니다!
const localState = { ...awareness?.getLocalState() } as S; | ||
|
||
storeRef.current = { states, localState }; | ||
onStoreChange(); |
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.
(1점) 객체를 복사하여 사용하는 이유가 궁금합니다 (순수궁금)
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.
레퍼런스를 복사하지 않고, 순수하게 내용만 복사해서 저 때의 상태를 복사하려 했었습니다. -> 근데 이것도 내부에 다른 객체들이 있어서 별 의미는 없겠네요..ㅎㅎ
그런데 생각해보니 localState는 레퍼런스로 복사해도 문제가 될 부분이 없는 것 같아 복사하지 않는 방향으로 수정했습니다! 감사합니다~!
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.
호균님 고생 많으셨습니다!
특히 useCallback은 이번에 처음 알게되었는데, 호균님 코드를 보면서 항상 많이 배우는 것 같아요.
- throttle 간격 0.1초는 실시간 커서 공유 간격으로 괜찮아보여요. 서버 부하가 크다고 느껴지만 조금 간격을 늘려도 괜찮을 것 같습니다. 일반적으로는 100ms~1000ms 라고 하네요
- 줌 레벨에 따라서 커서 크기를 조절할 수 있겠지만 현 상황에서 우선순위가 큰 태스크라고 생각되지는 않습니다! 추후 개선사항으로 남겨놓을 수 있을 것 같아요
2910daf
to
8224b5b
Compare
bea86aa
to
0428f0b
Compare
✅ 작업 내용
🏷️ 관련 이슈
📸 스크린샷/영상
2024-11-27.6.17.39.mov
📌 리뷰 진행 시 참고 사항
3점: 너무 많은 요청을 보내는 게 좋을 것 같진 않아 throttle 처리 + 애니메이션 처리를 해주었습니다. 이때 100ms 간격으로 설정했는데 적절할까요?
4점: 현재 konva로 그리고 있는데, stage 확대 축소 시 커서도 같이 확대 축소됩니다. 이 부분을 개선하는 게 좋을지..
중요: Head UI가 필요해, 앞선 PR이 먼저 머지되어야 덜 꼬일 것 같습니다