JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 199392
  • Score
    100M100P100Q172164F
  • License MIT

Package Exports

  • @react-hook/debounce

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@react-hook/debounce) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@react-hook/debounce

A hook for debouncing values and callbacks.

Installation

yarn add @react-hook/debounce

Usage

import {useDebounce, useDebounceCallback} from '@react-hook/debounce'

const F = props => {
    // basic usage
    const [value, setValue] = useDebounce('initialValue', 200/*wait*/, true/*leading*/)

    // this is actually the same code for useDebounce()
    const [state, setState] = useState(initialState)
    const [state, debouncedState] = useDebounceCallback(setState, 200/*wait*/, true/*leading*/)
}