// ets_tracing: off import * as E from "../../../Either/index.js" import { identity } from "../../../Function/index.js" import type * as C from "./core.js" import * as Map from "./map.js" import * as RaceBoth from "./raceBoth.js" /** * Runs both sinks in parallel on the input, returning the result or the error from the * one that finishes first. */ export function race_( self: C.Sink, that: C.Sink ): C.Sink { return Map.map_(RaceBoth.raceBoth_(self, that), E.fold(identity, identity)) } /** * Runs both sinks in parallel on the input, returning the result or the error from the * one that finishes first. */ export function race( that: C.Sink ) { return (self: C.Sink) => race_(self, that) }