Обзор
typeComposition

TaskContext

Runtime context provided to a `task` callback.

Signature

tsSignature
export type TaskContext<C extends object = {}> = RuntimeContext<C> & {
ok: typeof ok;
succeed: typeof ok;
fail: typeof err;
err: typeof err;
};

Imports

tsImport
import { TaskContext } from "@/lib/flow/task";
import { TaskContext } from "@/lib/flow";

Type Parameters

C

Custom context object type.

Details

The context includes the standard Flow runtime context plus helpers for creating explicit

success and failure results.

err

Re-exports core result helpers used by advanced record internals.

re-export
fail

Creates a behavior that always fails with the same domain error.

function
ok

Re-exports core result helpers used by advanced record internals.

re-export
succeed

Creates a behavior that always succeeds with the same value.

function

Source

tsflow/task.ts:12-17
export type TaskContext<C extends object = {}> = RuntimeContext<C> & {
ok: typeof ok;
succeed: typeof ok;
fail: typeof err;
err: typeof err;
};