import type { Operation, Yielded } from "./types.js"; /** * Race the given operations against each other and return the value of * whichever operation returns first. This has the same purpose as * [Promise.race](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race). * * If an operation become errored first, then `race` will fail with this error. * After the first operation wins the race, all other operations will become * halted and therefore cannot throw any further errors. * * @example * * ```typescript * import { race, sleep, call } from "effection"; * * let fastest = yield* race([ * call(function* () { * yield* sleep(100); * // this is halted as it loses the race * return "slow"; * }), * call(function* () { * yield* sleep(10); * return "fast"; * }), * ]); * * console.log(fastest); // "fast" * ``` * * @param operations a list of operations to race against each other * @returns the value of the fastest operation * @since 3.0 */ export declare function race>(operations: readonly T[]): Operation>;