Обзор
functionCore Record

raceSuccess

Creates a keyed race success payload.

Signature

tsSignature
export function raceSuccess<K extends PropertyKey, V>(
key: K,
value: V,
): {
key: K;
value: V;
};

Imports

tsImport
import { raceSuccess } from "@/lib/flow/core/record";
import { raceSuccess } from "@/lib/flow";

Type Parameters

K

Winning key type.

V

Winning value type.

Parameters

key
K

Behavior key that settled successfully.

value
V

Successful child value.

Returns

Keyed success payload.

Return type
{ key: K; value: V; }

Source

tsflow/core/record.ts:189-197
export function raceSuccess<K extends PropertyKey, V>(
key: K,
value: V,
): {
key: K;
value: V;
} {
return { key, value };
}