• E(x) returns a proxy on which you can call arbitrary methods. Each of these method calls returns a promise. The method will be invoked on whatever 'x' designates (or resolves to) in a future turn, not this one.

    Type Parameters

    • T

    Parameters

    • x: T

      target for method/function call

    Returns ECallableOrMethods<RemoteFunctions<T>>

    method/function call proxy

Properties

get: (<T>(x: T) => EGetters<LocalRecord<T>>) = ...

E.get(x) returns a proxy on which you can get arbitrary properties. Each of these properties returns a promise for the property. The promise value will be the property fetched from whatever 'x' designates (or resolves to) in a future turn, not this one.

Type declaration

    • <T>(x): EGetters<LocalRecord<T>>
    • Type Parameters

      • T

      Parameters

      • x: T

        target for property get

      Returns EGetters<LocalRecord<T>>

      property get proxy

resolve: {
    (): Promise<void>;
    <T>(value: T): Promise<Awaited<T>>;
    <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
} = HandledPromise.resolve

E.resolve(x) converts x to a handled promise. It is shorthand for HandledPromise.resolve(x)

Type declaration

    • (): Promise<void>
    • Creates a new resolved promise.

      Returns Promise<void>

      A resolved promise.

    • <T>(value): Promise<Awaited<T>>
    • Creates a new resolved promise for the provided value.

      Type Parameters

      • T

      Parameters

      • value: T

        A promise.

      Returns Promise<Awaited<T>>

      A promise whose internal state matches the provided promise.

    • <T>(value): Promise<Awaited<T>>
    • Creates a new resolved promise for the provided value.

      Type Parameters

      • T

      Parameters

      • value: T | PromiseLike<T>

        A promise.

      Returns Promise<Awaited<T>>

      A promise whose internal state matches the provided promise.

value to convert to a handled promise

handled promise for x

sendOnly: (<T>(x: T) => ESendOnlyCallableOrMethods<RemoteFunctions<T>>) = ...

E.sendOnly returns a proxy similar to E, but for which the results are ignored (undefined is returned).

Type declaration

    • <T>(x): ESendOnlyCallableOrMethods<RemoteFunctions<T>>
    • Type Parameters

      • T

      Parameters

      • x: T

        target for method/function call

      Returns ESendOnlyCallableOrMethods<RemoteFunctions<T>>

      method/function call proxy

when: (<T, U>(x: T | PromiseLike<T>, onfulfilled?: ((value: T) => ERef<U>), onrejected?: ((reason: any) => ERef<U>)) => Promise<U>) = ...

E.when(x, res, rej) is equivalent to HandledPromise.resolve(x).then(res, rej)

Type declaration

    • <T, U>(x, onfulfilled?, onrejected?): Promise<U>
    • Type Parameters

      • T
      • U = T

      Parameters

      • x: T | PromiseLike<T>

        value to convert to a handled promise

      • Optionalonfulfilled: ((value: T) => ERef<U>)
      • Optionalonrejected: ((reason: any) => ERef<U>)
          • (reason): ERef<U>
          • Parameters

            • reason: any

            Returns ERef<U>

      Returns Promise<U>