|
|
**Basic syntax:**
|
|
|
|
|
|
`debounce(func,[wait=0],[reverse=false])`
|
|
|
|
|
|
Work like any standard debounce function. The only thing needs to be notice is that if set the last argument to true. Then it will accept the first function call during the duration instead of the last one like the standard way.
|
|
|
|
|
|
**Usage case:**
|
|
|
|
|
|
`document.addEventListener('scroll', debounce(_onScroll, 50));`
|
|
|
|