
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
use-debouncy
Advanced tools
🌀 Small (~0.2kb) debounce effect hook for React with TypeScript support
🌀 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 29,012 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.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.