New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

use-debouncy

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-debouncy

🌀Small (120 bytes) debounce effect hook for React with TypeScript support

  • 2.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33K
decreased by-23.5%
Maintainers
1
Weekly downloads
 
Created
Source

useDebouncy

🌀Small (120 bytes) debounce effect hook for React with TypeScript support

license dependents types codecov

Features

  • 👌 No dependencies.
  • 🏋️‍ Tiny. 120 bytes. Size Limit controls the size.
  • 📖 Types. Support TypeScript.
  • 🎣 Easy. Like useEffect hook.

Installation

# NPM
npm install use-debouncy

# YARN
yarn add use-debouncy

Check bit component here

# Import bit component
bit import eavam.use-debouncy/use-debounce

Usage

Demo codesandbox

import React, { useState } from 'react';
import useDebouncy from 'use-debouncy';

const App = () => {
  const [value, setValue] = useState('');

  useDebouncy(
    () => fetchData(value), // function debounce
    400, // number of milliseconds to delay
    [value], // array values that the debounce depends (like as useEffect)
  );

  return (
    <input value={value} onChange={(event) => setValue(event.target.value)} />
  );
};

API Reference

useDebouncy

function useDebouncy(
  fn: () => void | (() => void | undefined),
  wait?: number,
  deps?: any[],
): void;
PropRequiredDefaultDescription
fnDebounce callback.
wait0Number of milliseconds to delay.
deps[]Array values that the debounce depends (like as useEffect).

Keywords

FAQs

Package last updated on 05 Jul 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc