@types/promise-inflight
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Installation

npm install --save @types/promise-inflight

Summary

This package contains type definitions for promise-inflight (https://github.com/iarna/promise-inflight#readme).

Details

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

index.d.ts

export = inflight;

type Resolvable<T> = PromiseLike<T> | T;
/**
 * @param unique A globally-unique key that is used to identify the call to this
 * function. It determines how to cache the inlfight request. eg. a url or
 * filename or whatever.
 * @param doFly The function that actually carries out the request, eg. fetches
 * the url or whatever.
 * @returns One promise as long as the `doFly()` promise is pending. Note that
 * if `bluebird` is installed, this promise will be a Bluebird promise.
 */
declare function inflight<T>(
    unique: Resolvable<string> | Resolvable<ReadonlyArray<Resolvable<string>>>,
    doFly: () => Resolvable<T>,
): Promise<T>;

declare namespace inflight {
    const active: {
        [key: string]: Promise<any>;
    };
}

Additional Details

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

Credits

These definitions were written by Emily Marigold Klassen.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/promise-inflight

Weekly Downloads

6,886

Version

1.0.3

License

MIT

Unpacked Size

4.14 kB

Total Files

5

Last publish

Collaborators

  • types