CommandHandle interface

Namespace @runic-artifex/vue · @runic-artifex/vue 0.7.0-preview.5

interface CommandHandle<TArgs extends readonly unknown[], TResult, TFailure = BridgeOutcomeFailure<TResult>>

No documentation.

Properties

pending

readonly pending: boolean;

True while a run is in flight.

error

readonly error: unknown;

Why the latest run failed unexpectedly, until the next run starts.

failure

readonly failure: TFailure | undefined;

The declared failure of the latest run, for a command that resolves a BridgeOutcome, until the next run starts. A superseded run sets neither.

Methods

run

run(...args: TArgs): Promise<TResult | undefined>;

Runs the command. Resolves to its result, including a BridgeOutcome with a declared failure, which failure then holds, or to undefined after an unexpected failure, which error then holds. Never rejects.

reset

reset(): void;

Clears error and failure.