# Fx.tap

Performs an effect for each element of the Fx, without changing the elements.

## Signatures

```ts
export declare const tap: {
    <A, E2 = never, R2 = never>(f: (a: A) => void | Effect.Effect<unknown, E2, R2>): <E, R>(self: Fx<A, E | E2, R>) => Fx<A, E | E2, R | R2>;
    <A, E, R, E2 = never, R2 = never>(self: Fx<A, E | E2, R>, f: (a: A) => void | Effect.Effect<unknown, E2, R2>): Fx<A, E | E2, R | R2>;
};
```

## Why

`tap` sequences an observation or side effect before forwarding each original value. It emits
exactly once per successful callback, in source order; callback failure prevents that value.

## Ownership and lifetime

Returned Effects run in the consumer path and are interrupted with it; a `void` callback is
treated as `Effect.void`. Callback failures and services remain visible in the result type.

## Examples

```ts
import { Effect } from "effect"
import { Fx } from "@typed/fx"
const logged = Fx.fromIterable([1, 2]).pipe(Fx.tap((n) => Effect.log(n)))
```
