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

무한스크롤 및 스크롤 관련 #295

Open
jin-Pro opened this issue Aug 9, 2022 · 0 comments
Open

무한스크롤 및 스크롤 관련 #295

jin-Pro opened this issue Aug 9, 2022 · 0 comments

Comments

@jin-Pro
Copy link
Member

jin-Pro commented Aug 9, 2022

리팩토링 이전 코드에서는 모두 스크롤이벤트를 두어 dom의 height을 계속 비교해주게 되었다.

  • 쓰로틀 사용하는 방법
  • ref 객체 사용

두 가지 방법으로 성능을 감소해줄수있을 것 같다.
쓰로틀을 사용하면 말 그대로, 처음 한번만 api 요청을 진행할 수 있게 된다.
ref 객체를 사용한다면, ref 객체가 화면 view에 나타나면 api 요청을 진행한다.

ref 객체를 사용하면 스크롤 이벤트를 사용하지 않아도 됄 것이고,
쓰로틀을 사용하면 중복 요청을 보내지 않아도 됀다.

ref 객체와 쓰로틀 두가지 기법을 동시에 사용할수도 있을 것 같다.

  • 채팅 페이지
  • 프로필 페이지
    두가지 페이지에서 사용됄 것 같다.
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

No branches or pull requests

1 participant