# Fx.takeWhileEffect

Takes elements from an Fx while an effectful predicate returns true.
Stops at the first element for which the predicate effect succeeds with false; that element is not included.

## Signatures

```ts
export declare const takeWhileEffect: {
    <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

`takeWhileEffect` performs the prefix decision with Effect and completes before the first false
value, retaining source order.

## Ownership and lifetime

Predicate effects expose their failures and services and are interrupted with the run. A false
result stops upstream; no independent fiber or buffer is retained.

## Examples

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