Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
use-debouncy
Advanced tools
🌀 Small (~0.2kb) debounce effect hook for React with TypeScript support
npm install use-debouncy
yarn add use-debouncy
import React, { useState } from 'react';
import { useDebouncyEffect } from 'use-debouncy';
const App = () => {
const [value, setValue] = useState('');
useDebouncyEffect(
() => 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)} />;
};
import React, { useState } from 'react';
import { useDebouncyFn } from 'use-debouncy';
const App = () => {
const handleChange = useDebouncyFn(
(event) => fetchData(event.target.value), // function debounce
400, // number of milliseconds to delay
);
return <input value={value} onChange={handleChange} />;
};
function useDebouncyEffect(fn: () => void, wait?: number, deps?: any[]): void;
Prop | Required | Default | Description |
---|---|---|---|
fn | ✓ | Debounce callback. | |
wait | 0 | Number of milliseconds to delay. | |
deps | [] | Array values that the debounce depends (like as useEffect). |
function useDebouncyFn(fn: (...args: any[]) => void, wait?: number): (...args: any[]) => void;
Prop | Required | Default | Description |
---|---|---|---|
fn | ✓ | Debounce handler. | |
wait | 0 | Number of milliseconds to delay. |
FAQs
🌀 Small (~0.2kb) debounce effect hook for React with TypeScript support
The npm package use-debouncy receives a total of 25,972 weekly downloads. As such, use-debouncy popularity was classified as popular.
We found that use-debouncy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.