Обзор
functionCore Runtime

resultFromSignal

Converts an aborted signal into a cancellation result.

Signature

tsSignature
export function resultFromSignal(signal: AbortSignal): Err<Cancelled>;

Imports

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

Parameters

signal
AbortSignal

Aborted signal whose reason should be preserved.

Returns

A failed result containing `Cancelled`.

Return type
Err<Cancelled>

Source

tsflow/core/runtime.ts:269-271
export function resultFromSignal(signal: AbortSignal): Err<Cancelled> {
return cancelled(signal.reason);
}