2.0.1 • Published 2 years ago
rescript-debounce-react v2.0.1
rescript-debounce-react
Debounce 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!
Installation
# yarn
yarn add rescript-debounce-react
# or npm
npm install --save rescript-debounce-reactThen add it to rescript.json:
"bs-dependencies": [
"rescript-debounce-react"
]Usage
// With default timeout (100ms)
let fn = fn->ReactDebounce.useDebounced
// With configured timeout
let fn = fn->ReactDebounce.useDebounced(~wait=250)
// Controlled hook
let fn = fn->ReactDebounce.useControlledSee rescript-debounce for more details.
License
MIT.