@vivliostyle/core
    Preparing search index...

    Interface Result<T>

    Result of an asynchronous function that may be available immediately or some time later. Similar to Deferred.

    interface Result<T> {
        get(): T;
        isPending(): boolean;
        then(callback: (p1: T) => void): void;
        thenAsync<T1>(callback: (p1: T) => Result<T1>): Result<T1>;
        thenFinish(frame: Frame<T>): void;
        thenReturn<T1>(result: T1): Result<T1>;
    }

    Type Parameters

    • T

    Implemented by

    Index

    Methods

    • If this Result is resolved, return the value that it holds.

      Returns T

    • Check if this Result is still pending.

      Returns boolean

    • Call the given function when asynchronous function is finished. Callback is executed in the task's context.

      Parameters

      • callback: (p1: T) => void

      Returns void

    • Call the given asynchronous function when some asynchronous function is finished. Callback is executed in the task's context.

      Type Parameters

      • T1

      Parameters

      Returns Result<T1>

    • Finish given frame with the result value when result becomes ready.

      Parameters

      Returns void

    • Produce a Result that resolves to the given value when this Result is resolved.

      Type Parameters

      • T1

      Parameters

      • result: T1

      Returns Result<T1>