# Fx.first

Returns the first value emitted by the `Fx` wrapped in an `Option`.
If the `Fx` is empty, returns `None`.

## Signatures

```ts
export declare function first<A, E, R>(fx: Fx<A, E, R>): Effect<Option<A>, E, R>;
```

## Why

`first` safely crosses from a possibly empty push source to one Effect value without
inventing an error for the zero-emission case.

## Ownership and lifetime

Running the Effect subscribes once and stops upstream after the first value. It
returns `None` only when the source completes first; a source failure is still `E`.
Interruption cleans up the active source.

## Examples

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

const program = first(fromIterable([10, 20])).pipe(
  Effect.map(Option.getOrElse(() => 0))
)
```
