EffectAction interface

Module @runic-artifex/views-effect in @runic-artifex/views-effect 0.23.0

interface EffectAction<Args extends readonly unknown[], A, E>

A latest-wins Effect workflow projected into framework-neutral state.

Properties

current

readonly current: EffectActionState<A, E>;

No documentation.

Methods

subscribe

subscribe(listener: () => void): () => void;

Calls listener after each change of current, until the returned function is called.

run

run(...args: Args): Promise<Exit.Exit<A, E>>;

Interrupts the previous run of this action, then runs the program. Resolves to the run's Exit and never rejects. A superseded run does not update current.

interrupt

interrupt(): Promise<void>;

Interrupts the current run, which cancels an interrupted operation in .NET.

reset

reset(): void;

Returns to idle. Has no effect while a run is in flight.

dispose

dispose(): Promise<void>;

Interrupts the current run and stops publishing. It returns a Promise because interrupting a fiber is asynchronous; [Symbol.asyncDispose] calls it.