React hook for to throttle functions
npm install @slynch13/usethrottle> React hook for to throttle functions
 
``bash`
npm install --save usethrottle
`jsx
import React, { useState, useEffect } from 'react'
import { useThrottle } from 'usethrottle'
const App = () => {
let [example, setExample] = useState(0)
const throttled = useThrottle((x) => setExample(x), 1000)
useEffect(() => {
throttled(example + 1)
}, [example])
return (
``
MIT © slynch13
---
This hook is created using create-react-hook.