Type alias TThenable<T>

TThenable<T>: {
    src: T | Promise<T>;
    then: ((okHandler: ((value: any, isSync?: boolean) => any)) => any);
    value?: T;
}

Used by the thenable method, that turns any synchronous value into something with a 'then' method, so we can reuse the same code regardless whether the input is synchronous or asynchronous.

It exposes 2 properties: then(), which works as you know from promises, and src, which is the actual input (which is either a simple value or a promise).

Type Parameters

  • T = any

Type declaration

  • src: T | Promise<T>
  • then: ((okHandler: ((value: any, isSync?: boolean) => any)) => any)
      • (okHandler: ((value: any, isSync?: boolean) => any)): any
      • Parameters

        • okHandler: ((value: any, isSync?: boolean) => any)
            • (value: any, isSync?: boolean): any
            • Parameters

              • value: any
              • Optional isSync: boolean

              Returns any

        Returns any

  • Optional value?: T

Generated using TypeDoc