# Fx.raceAll

Races many streams: the first to emit wins and the rest are interrupted.

## Signatures

```ts
export declare const raceAll: <FX extends ReadonlyArray<Fx<any, any, any>>>(...fxs: FX) => Fx<Fx.Success<FX[number]>, Fx.Error<FX[number]>, Fx.Services<FX[number]>>;
```

## Why

`raceAll` extends {@link race} to a runtime-sized set while preserving the
first-value selection rule.

## Selection, ordering, and cardinality

All inputs start concurrently. The first emitted value selects one input and
only that input's values are forwarded afterward. Zero inputs produce the
empty Fx; one input is returned unchanged. No result buffer is retained.

## Ownership and lifetime

Before selection, the first non-interruption failure is retained and reported
only if every input ends without emitting. After selection, winner failures
are forwarded. All environments are required. Losers are interrupted and the
observing fiber owns cleanup for every child.

## Examples

```ts
import { Fx } from "@typed/fx"
import { Effect } from "effect"

const response = Fx.raceAll(
  Fx.at("cache", "30 millis"),
  Fx.at("primary", "5 millis"),
  Fx.at("replica", "20 millis")
)
Effect.runPromise(Fx.collectAll(response)).then(console.log)
// ["primary"]
```
