npm.io
1.0.2 • Published 3 years ago

@types/promise-debounce

Licence
MIT
Version
1.0.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/promise-debounce

Summary

This package contains type definitions for promise-debounce (https://github.com/jaz303/promise-debounce).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-debounce.

index.d.ts

/**
 * Returns a debounced version of `fn` with optional calling context `ctx`.
 *
 * `fn` must be a function which returns a promise.
 *
 * If `debounced` is called and no other call is currently pending,
 * `fn` will be called and its promise returned.
 *
 * Otherwise - if another call is pending - the original promise will be returned.
 */
declare function debounce<A extends readonly any[], R extends PromiseLike<any>, T = undefined>(
    fn: (this: T, ...args: A) => R,
    ctx?: T,
): (...args: A) => R;

export = debounce;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by ExE Boss.