Throttle custom hook for React
Argument | Type | Description | Default value |
---|---|---|---|
callback (required) | Function | Function that needs to be throttled | undefined |
timeout (optional) | Number | Time to throttle the callback in ms | 300 |
Return value | Type | Description |
---|---|---|
throttledFunction | Function | A throttled function that will run at most once per timeout ms |
isReady | Boolean | Tells whether calling throttledFunction at that point will fire or not |
Join our discord server! You can click the floating discord icon at the bottom right of the screen and chat with us!