Skip to content

자바스크립트 성능 개선 lodash throttle #14

Description

@daehwan2

스크롤 이벤트나 마우스무브이벤트와 같이 이벤트가 무수하게 반복적으로 많이 일어날때

콜백 함수가 많이 실행되게 되어서 성능상 안좋다. 이 때 약간의 딜레이를 주면서 콜백함수를 실행시키는 함수로

lodash 라이브러리의 throttle이 있다.

ex)

window.addEventListener('resize', _.throttle(detectTabPanelPosition, 1000));
window.addEventListener('scroll', _.throttle(updateActiveTabOnScroll, 300));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions