New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

use-debounce-maker

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-debounce-maker

light weight react custom hook to make function debounced

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

useDebounceWrapper

React hook to make a function debounced. https://www.npmjs.com/package/use-debounce-maker

Usage

import useDebounceMaker from "use-debounce-maker";

export default function Example() {
  //'debouncedMyFunc' is now a debounced version of function myFunc and debounced with 1000 milliseconds.
  const debouncedMyFunc = useDebounceMaker(myFunc, 1000);

  function myFunc(e) {
    console.log("Input value: " + e.target.value);
  }

  return <input onChange={debouncedMyFunc} />;
}

View on Codesandbox

Params

ParamTypeRequiredDefaultDescription
funcanytruenullThe function to be debounced
durationnumberfalse300duration for the debounce delay

https://www.npmjs.com/package/use-debounce-maker

FAQs

Package last updated on 03 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts