# Fx.collectAll

Collects all values emitted by an `Fx` into an array.

## Signatures

```ts
export declare const collectAll: <A, E = never, R = never>(fx: Fx<A, E, R>) => Effect.Effect<ReadonlyArray<A>, E, R>;
```

## Why

Finite producers sometimes need to cross from push processing back to one Effect
value. `collectAll` makes that buffering explicit rather than hiding it in `Fx`.

## Ownership and lifetime

The array is allocated separately for each Effect run. Subscription starts when the
Effect runs and ends on source completion, failure, or interruption. Every emitted
value is retained until completion, so an infinite source never completes and can
grow memory without bound. Failures and services remain in `E` and `R`.

## Examples

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

const program = collectAll(fromIterable([1, 2, 3])).pipe(
  Effect.map((values) => values.reduce((sum, value) => sum + value, 0))
)
```
