README
rescript-throttle-react
Throttle hooks for @rescript/react
.
Installation
# yarn
yarn add rescript-throttle-react
# or npm
npm install --save rescript-throttle-react
Then add it to bsconfig.json
:
"bs-dependencies": [
"rescript-throttle-react"
]
Usage
// With default timeout (100ms)
let fn = ReactThrottle.useThrottled(fn)
// With configured timeout
let fn = ReactThrottle.useThrottled(~wait=250, fn)
// Controlled hook
let fn = ReactThrottle.useControlled(fn)
See rescript-throttle
for more details.
License
MIT.