effect-io-ai

Package: effect
Module: Context

Context.mutate

Performs a series of mutations on a Context. Prevents unnecessary copying of the underlying map when multiple mutations are needed.

When to use

Use to apply several Context transformations in one callback while copying the underlying service map only once.

See

Signature

declare const mutate: { <Services, B>(f: (context: Context<Services>) => Context<B>): <Services>(self: Context<Services>) => Context<B>; <Services, B>(self: Context<Services>, f: (context: Context<Services>) => Context<B>): Context<B>; }

Source

Since v4.0.0