Skip to content

Instantly share code, notes, and snippets.

View Spidy88's full-sized avatar

Nick Ferraro Spidy88

View GitHub Profile
@Spidy88
Spidy88 / useDebounce.tsx
Last active May 28, 2025 23:17
React Hook - useDebounce
import debounce from 'lodash/debounce';
import noop from 'lodash/noop';
import { useState, useCallback, useRef } from 'react';
interface UseDebounceOptions<T> {
initialValue: T;
onChange?: (value: T) => void;
debounceTime?: number;
}