UNPKG

@ai-sdk/react

Version:

[React](https://react.dev/) UI components for the [AI SDK](https://ai-sdk.dev/docs):

9 lines (7 loc) 214 B
import throttleFunction from 'throttleit'; export function throttle<T extends (...args: any[]) => any>( fn: T, waitMs: number | undefined, ): T { return waitMs != null ? throttleFunction(fn, waitMs) : fn; }