@signaldb/sync
Version:
This is the sync implementation of [SignalDB](https://github.com/maxnowack/signaldb). SignalDB is a local-first JavaScript database with real-time sync, enabling optimistic UI with signal-based reactivity across multiple frameworks.
16 lines (15 loc) • 670 B
TypeScript
type DebounceOptions = {
leading?: boolean;
trailing?: boolean;
};
/**
* Debounces a function.
* @param fn Function to debounce
* @param wait Time to wait before calling the function.
* @param [options] Debounce options
* @param [options.leading] Whether to call the function on the leading edge of the wait interval.
* @param [options.trailing] Whether to call the function on the trailing edge of the wait interval.
* @returns The debounced function.
*/
export default function debounce<Arguments extends any[], T, ThisType>(fn: (this: ThisType, ...args: Arguments) => T, wait: number, options?: DebounceOptions): (...args: Arguments) => T;
export {};