effect-io-ai

Package: effect
Module: Sink

Sink.mapEffect

Transforms this sink’s result effectfully.

When to use

Use when you need a sink result transformation that is effectful, can fail, or requires services.

Details

The transformed sink preserves the original sink’s input consumption and leftovers while adding the errors and requirements of the transformation.

See

Signature

declare const mapEffect: { <A, A2, E2, R2>(f: (a: A) => Effect.Effect<A2, E2, R2>): <In, L, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L, E2 | E, R2 | R>; <A, In, L, E, R, A2, E2, R2>(self: Sink<A, In, L, E, R>, f: (a: A) => Effect.Effect<A2, E2, R2>): Sink<A2, In, L, E | E2, R | R2>; }

Source

Since v2.0.0