Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

prevent a function from being called too many times react

This can be achieved in the below possible ways,

    Throttling: Changes based on a time based frequency. For example, it can be used using _.throttle lodash function
    Debouncing: Publish changes after a period of inactivity. For example, it can be used using _.debounce lodash function
    RequestAnimationFrame throttling: Changes based on requestAnimationFrame. For example, it can be used using raf-schd lodash function
 
PREVIOUS NEXT
Tagged: #prevent #function #called #times #react
ADD COMMENT
Topic
Name
3+6 =