@uwdata/mosaic-core
Version:
Scalable and extensible linked data views.
12 lines • 673 B
TypeScript
/**
* Throttle invocations of a callback function. The callback must return
* a Promise. Upon repeated invocation, the callback will not be invoked
* until a prior Promise resolves. If multiple invocations occurs while
* waiting, only the most recent invocation will be pending.
* @param callback The callback function.
* @param debounce Flag indicating if invocations
* should also be debounced within the current animation frame.
* @returns A new function that throttles access to the callback.
*/
export declare function throttle<E, T>(callback: (event?: E) => Promise<T> | null, debounce?: boolean): (event?: E) => void;
//# sourceMappingURL=throttle.d.ts.map