effect-io-ai

Package: effect
Module: Schedule

Schedule.reduceEffect

Returns a new schedule that effectfully folds over the outputs of this one.

Details

This schedule accumulates outputs over time using an effectful reducer function f. It starts with an initial value zero and updates it asynchronously or based on external dependencies.

This is useful for asynchronous state tracking, logging, external metrics aggregation, or any scenario where accumulation needs to involve an effectful computation.

See

Signature

declare const reduceEffect: { <Z, Out, R2>(zero: Z, f: (z: Z, out: Out) => Effect.Effect<Z, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Z, In, R2 | R>; <Out, In, R, Z, R2>(self: Schedule<Out, In, R>, zero: Z, f: (z: Z, out: Out) => Effect.Effect<Z, never, R2>): Schedule<Z, In, R | R2>; }

Source

Since v2.0.0