Throttle hooks for @rescript/react
npm install rescript-throttle-react


Throttle hooks for @rescript/react.
> ### ShakaCode
> If you are looking for help with the development and optimization of your project, ShakaCode can help you to take the reliability and performance of your app to the next level.
>
> If you are a developer interested in working on ReScript / TypeScript / Rust / Ruby on Rails projects, we're hiring!
``shell`yarn
yarn add rescript-throttle-reactor npm
npm install --save rescript-throttle-react
Then add it to rescript.json:
`json`
"bs-dependencies": [
"rescript-throttle-react"
]
`rescript
// With default timeout (100ms)
let fn = fn->ReactThrottle.useThrottled
// With configured timeout
let fn = fn->ReactThrottle.useThrottled(~wait=250)
// Controlled hook
let fn = fn->ReactThrottle.useControlled
`
See rescript-throttle` for more details.
MIT.