ReactiveActionSource

type ReactiveActionSource<T> = object;

Duck-type for objects that build a ReactiveActionStore on demand via reactiveStore(). Satisfied by PendingRpcRequest<T>. The [] argument tuple is intentional — the operation's arguments are already baked into the pending request, so each dispatch() re-fires the same call.

The returned store is in the idle state — the caller is responsible for calling dispatch() to fire the first attempt. Attach a caller-provided cancellation source per dispatch via store.withSignal(signal).dispatch(...) — see ReactiveActionStore.withSignal.

Example

function bind<T>(source: ReactiveActionSource<T>) {
    const store = source.reactiveStore();
    // Per-attempt timeout, fresh signal per call:
    store.withSignal(AbortSignal.timeout(30_000)).dispatch();
    return store;
}

See

Type Parameters

Type ParameterDescription
TThe value type resolved by the wrapped operation.

Methods

reactiveStore()

reactiveStore(): ReactiveActionStore<[], T>;

Returns

ReactiveActionStore<[], T>

On this page