From bef4fdb6525688b2a9187983d59657848de37e7d Mon Sep 17 00:00:00 2001 From: Kael Shipman Date: Fri, 29 Dec 2023 20:39:57 -0700 Subject: [PATCH] publishing --- docs/classes/DebouncedFunc.html | 4 ++-- docs/classes/Debouncer.html | 6 +++--- docs/interfaces/DebouncedFuncInterface.html | 4 ++-- docs/interfaces/DebouncerInterface.html | 4 ++-- docs/types/DebouncedFuncStatuses.html | 2 +- docs/types/GenericDebouncerContract.html | 2 +- package.json | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/classes/DebouncedFunc.html b/docs/classes/DebouncedFunc.html index f57dd41..61d2627 100644 --- a/docs/classes/DebouncedFunc.html +++ b/docs/classes/DebouncedFunc.html @@ -3,7 +3,7 @@
const myFunc = new DebouncedFunc(60);

const p: Array<Promise<"canceled" | number>> = [];
for (let i = 0; i < 5; i++) {
p.push(myFunc.bounce(() => i));
}

console.log(Proimse.all(p));

// Output:
// [ "canceled", "canceled", "canceled", "canceled", 4]

Type Parameters

Implements

Constructors

Implements

Constructors

Properties

waitMs _status timeout @@ -11,4 +11,4 @@

Accessors

Methods

Constructors

Properties

waitMs: number
_status: DebouncedFuncStatuses = "waiting"
timeout: null | Timeout = null
promise: null | {
    resolve: ((val) => void);
    reject: ((e) => void);
} = null

Type declaration

  • resolve: ((val) => void)
      • (val): void
      • Parameters

        • val: "canceled" | T

        Returns void

  • reject: ((e) => void)
      • (e): void
      • Parameters

        • e: Error

        Returns void

Accessors

Methods

Generated using TypeDoc

\ No newline at end of file +

Constructors

Properties

waitMs: number
_status: DebouncedFuncStatuses = "waiting"
timeout: null | Timeout = null
promise: null | {
    resolve: ((val) => void);
    reject: ((e) => void);
} = null

Type declaration

  • resolve: ((val) => void)
      • (val): void
      • Parameters

        • val: "canceled" | T

        Returns void

  • reject: ((e) => void)
      • (e): void
      • Parameters

        • e: Error

        Returns void

Accessors

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/Debouncer.html b/docs/classes/Debouncer.html index 4939881..ed5a3b7 100644 --- a/docs/classes/Debouncer.html +++ b/docs/classes/Debouncer.html @@ -6,11 +6,11 @@ accidental overlap. For example, you may accidentally call debouncer.bounce("init", ...) in multiple different components, and doing so would yield undesireable results since each call might inadvertently cancel a call from an unrelated component (and with unrelated results).

-

Implements

Constructors

Implements

Constructors

Properties

Methods

Constructors

Properties

cache: {
    [K in string | number | symbol]?: DebouncedFunc<Contract[K]>
} = {}
defaultWaitMs: number = 15

Methods

  • Executes the given function after the given wait time.

    +

Constructors

Properties

cache: {
    [K in string | number | symbol]?: DebouncedFunc<Contract[K]>
} = {}
defaultWaitMs: number = 15

Methods

  • Executes the given function after the given wait time.

    Type Parameters

    • K extends string | number | symbol = string

      The key you're using for this bounce. The key must be defined in the class's Contract, and the function you pass must return the value specified in the Contract for the given key. This parameter is not meant to be passed directly, but is instead inferred from the @@ -24,4 +24,4 @@

    Returns Promise<"canceled" | Contract[K]>

    A promise that resolves to the return value of the passed function, or the special string value "canceled" if this particular instance of the debounce was canceled by another call.

    -

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/DebouncedFuncInterface.html b/docs/interfaces/DebouncedFuncInterface.html index 2186f3c..99031a0 100644 --- a/docs/interfaces/DebouncedFuncInterface.html +++ b/docs/interfaces/DebouncedFuncInterface.html @@ -3,7 +3,7 @@
const myFunc = new DebouncedFunc(60);

const p: Array<Promise<"canceled" | number>> = [];
for (let i = 0; i < 5; i++) {
p.push(myFunc.bounce(() => i));
}

console.log(Proimse.all(p));

// Output:
// [ "canceled", "canceled", "canceled", "canceled", 4]
interface DebouncedFuncInterface {
    status: DebouncedFuncStatuses;
    bounce(f): Promise<"canceled" | T>;
    cancel(): void;
}

Type Parameters

Implemented by

Properties

Implemented by

Properties

Methods

Properties

Methods

  • Parameters

    • f: (() => T | Promise<T>)
        • (): T | Promise<T>
        • Returns T | Promise<T>

    Returns Promise<"canceled" | T>

Generated using TypeDoc

\ No newline at end of file +

Properties

Methods

  • Parameters

    • f: (() => T | Promise<T>)
        • (): T | Promise<T>
        • Returns T | Promise<T>

    Returns Promise<"canceled" | T>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/DebouncerInterface.html b/docs/interfaces/DebouncerInterface.html index c1eaba1..ee674c2 100644 --- a/docs/interfaces/DebouncerInterface.html +++ b/docs/interfaces/DebouncerInterface.html @@ -6,7 +6,7 @@ accidental overlap. For example, you may accidentally call debouncer.bounce("init", ...) in multiple different components, and doing so would yield undesireable results since each call might inadvertently cancel a call from an unrelated component (and with unrelated results).

-

Implemented by

Methods

Implemented by

Methods

Methods

  • Executes the given function after the given wait time.

    Type Parameters

    • K extends string | number | symbol = string

      The key you're using for this bounce. The key must be defined in the class's Contract, and the function you pass must return the value specified in the Contract for the @@ -21,4 +21,4 @@

Returns Promise<Contract[K] | "canceled">

A promise that resolves to the return value of the passed function, or the special string value "canceled" if this particular instance of the debounce was canceled by another call.

-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/DebouncedFuncStatuses.html b/docs/types/DebouncedFuncStatuses.html index 68df004..9c34e16 100644 --- a/docs/types/DebouncedFuncStatuses.html +++ b/docs/types/DebouncedFuncStatuses.html @@ -1,2 +1,2 @@ DebouncedFuncStatuses | @wymp/indexed-debouncer

Type alias DebouncedFuncStatuses

DebouncedFuncStatuses: "waiting" | "executing" | "done"

Statuses for a debounced function

-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/GenericDebouncerContract.html b/docs/types/GenericDebouncerContract.html index f98246b..165cc05 100644 --- a/docs/types/GenericDebouncerContract.html +++ b/docs/types/GenericDebouncerContract.html @@ -1,2 +1,2 @@ GenericDebouncerContract | @wymp/indexed-debouncer

Type alias GenericDebouncerContract

GenericDebouncerContract: {
    [k in string]: any
}

A generic debounce contract. See DebouncerInterface for more information.

-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/package.json b/package.json index e2c6849..0daf664 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "eslint src tests", "lint:fix": "pnpm lint --fix", "preinstall": "npx only-allow pnpm", - "prepublishOnly": "pnpm clean && pnpm build && npm run docgen", + "prepublishOnly": "pnpm clean && pnpm build && npm run docs:gen", "prettier": "prettier src tests --check", "prettier:fix": "pnpm prettier --write", "test": "pnpm typecheck && pnpm prettier && pnpm lint && pnpm test:jest",