race()
race: the FIRST dep to deliver DATA wins; thereafter only the winner’s messages flow (losers are
dropped, including their terminals). partial:true + ctx.state winner. errorWhenDepsError:false
(a LOSER’s error must not error the race — only the winner’s) + completeWhenDepsComplete:false + terminalAsRealInput:true. If every dep terminates before any DATA, COMPLETE.
Import
Section titled “Import”import { race } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function race(): Operator<S, S>Returns
Section titled “Returns”A Operator<S, S> value.
Example
Section titled “Example”import { race } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/combinators.ts