UNPKG

@explita/daily-toolset-form

Version:

A lightweight form toolkit for React built with developer ergonomics in mind. Includes a flexible Form component, useForm, useField, and useFormContext hooks for managing form state and validation with ease. Designed to simplify complex forms while remain

14 lines (13 loc) 638 B
/** * Creates a debounced function that delays invoking the provided function until * after `delay` milliseconds have passed since the last time the debounced * function was called. The debounced function returns a function that can be * used to cancel the pending call to the underlying function. * * @param fn The function to debounce. * @param delay The number of milliseconds to delay calling the function. * @returns A debounced function with an extra `cancel` method to cancel the pending call. */ export declare function debounce<T extends (...args: any[]) => void>(fn: T, delay: number): T & { cancel: () => void; };