Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
use-debouncy
Advanced tools
🌀 Small (~0.2kb) debounce effect hook for React with TypeScript support
# NPM
npm install use-debouncy
# YARN
yarn add use-debouncy
# Import bit component
bit import eavam.use-debouncy/use-debounce
import React, { useState } from 'react';
import useDebouncy from 'use-debouncy/effect';
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)} />
);
};
import React, { useState } from 'react';
import useDebouncy from 'use-debouncy/fn';
const App = () => {
const handleChange = useDebouncy(
(event) => fetchData(event.target.value),
400,
);
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.