# takeUntilEffect

Takes elements from an Fx until an effectful predicate returns true.
The element that satisfies the predicate is not included in the output.

## Signatures

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

## Why

`takeUntilEffect` makes the stopping decision Effectful and ordered. A successful match completes
before that input is emitted; a false result forwards it.

## Ownership and lifetime

Predicate effects run in the consumer and expose their failures and services. A match or
interruption stops upstream and cancels active work.

## Examples

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