Обзор
functionCore Runtime

cancelled

Creates a cancellation result.

Signature

tsSignature
export function cancelled(reason?: unknown): Err<Cancelled>;

Imports

tsImport
import { cancelled } from "@/lib/flow/core/runtime";
import { cancelled } from "@/lib/flow";

Parameters

reason
unknown

Optional cancellation reason from an `AbortSignal`.

Returns

A failed result containing `Cancelled`.

Return type
Err<Cancelled>

Source

tsflow/core/runtime.ts:211-217
export function cancelled(reason?: unknown): Err<Cancelled> {
if (reason === undefined) {
return err({ kind: "cancelled" });
}
return err({ kind: "cancelled", reason });
}