# filterMap

Maps each Fx output and emits only resulting `Some` values.

The upstream Sink evaluates `f` synchronously for each value, before its
returned downstream callback Effect runs. Mapping allocation and throws occur
at that callback invocation. `Some(c)` emits exactly one `c`; `None` emits
nothing. Relative order, errors, services, and input behavior are preserved.

## Signatures

```ts
export declare const filterMap: {
    <B, C>(f: (b: B) => Option.Option<C>): <A, E, R, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, C, E2, R2>;
    <A, E, R, B, E2, R2, C>(push: Push<A, E, R, B, E2, R2>, f: (b: B) => Option.Option<C>): Push<A, E, R, C, E2, R2>;
};
```

## Why

Combine output parsing and filtering without a sentinel value or a second pass.

## Ownership and lifetime

The mapper is synchronous at upstream `onSuccess` invocation and resource-free.
The wrapped Fx retains ownership of subscription, Scope, interruption, and
finalizers.

## Examples

```ts
import { Effect, Option } from "effect"
import * as Fx from "@typed/fx/Fx"
import * as Push from "@typed/fx/Push"
import * as Sink from "@typed/fx/Sink"

const push = Push.make(Sink.make(() => Effect.void, (_: string) => Effect.void), Fx.fromIterable(["1", "x"]))
const numbers = Push.filterMap(push, (text) => /^\d+$/.test(text) ? Option.some(Number(text)) : Option.none())
```
