Debounce hooks for @rescript/react
.
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!
# yarn
yarn add rescript-debounce-react
# or npm
npm install --save rescript-debounce-react
Then add it to bsconfig.json
:
"bs-dependencies": [
"rescript-debounce-react"
]
// With default timeout (100ms)
let fn = ReactDebounce.useDebounced(fn)
// With configured timeout
let fn = ReactDebounce.useDebounced(~wait=250, fn)
// Controlled hook
let fn = ReactDebounce.useControlled(fn)
See rescript-debounce
for more details.
MIT.