@greenlabs/rescript-use-debounce

9.0.0 • Public • Published

rescript-use-debounce

Binding of use-debounce package

Install

npm i @greenlabs/rescript-use-debounce
or
yarn add @greenlabs/rescript-use-debounce
"bs-dependencies": [
  "@greenlabs/rescript-use-debounce"
]

Usage

let test = () => {
  let (debouncedCallback, debouncedCallbackMethods) = useDebouncedCallback(e => {
    e->ReactEvent.Synthetic.preventDefault
  }, 500, ~options={maxWait: 500})

  (debouncedCallback, debouncedCallbackMethods.isPending())
}

Note

flush()'s type signature is unit => ReturnType<callback>, but couldn't find a way to achieve it in ReScript so left the return type as unit.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 9.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 9.0.0
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i @greenlabs/rescript-use-debounce

Weekly Downloads

0

Version

9.0.0

License

MIT

Unpacked Size

3.81 kB

Total Files

5

Last publish

Collaborators

  • minukang
  • gyeop
  • miryangjung
  • jaeholee.gl
  • namenu
  • moondaddi
  • yousleepwhen
  • kimchhickey