@open-react-hooks/use-throttle

Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled function comes with a cancel method to cancel delayed func invocations and a flush method to immediately invoke them.

Usage no npm install needed!

<script type="module">
  import openReactHooksUseThrottle from 'https://cdn.skypack.dev/@open-react-hooks/use-throttle';
</script>

README

@open-react-hooks/use-throttle

Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled function comes with a cancel method to cancel delayed func invocations and a flush method to immediately invoke them.