# filterEffect

Filters elements of an Fx using an effectful predicate function.

## Signatures

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

## Why

`filterEffect` supports service-backed or failing decisions without flattening a second Fx. Each
input runs one predicate Effect; `true` emits once and `false` emits nothing. The adapter does not
serialize concurrent producer deliveries, so accepted values may arrive out of input order.

## Ownership and lifetime

A predicate Effect belongs to the producer callback that invoked it. Its Cause is sent to the
Sink, `R2` stays required, and interruption follows that delivery. No lock or queue is added.

## Examples

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

const concurrent = Fx.make<number>((sink) =>
  Effect.all([sink.onSuccess(1), sink.onSuccess(2)], { concurrency: "unbounded", discard: true })
)
const positive = concurrent.pipe(Fx.filterEffect((n) => Effect.succeed(n > 0)))
```
