effect-io-ai

Package: effect
Module: Channel

Channel.let

Adds a computed field to each object emitted by a channel.

Signature

declare const let: { <N extends string, OutElem extends object, B>(name: Exclude<N, keyof OutElem>, f: (a: NoInfer<OutElem>) => B): <OutErr, OutDone, InElem, InErr, InDone, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, R>) => Channel<{ [K in N | keyof OutElem]: K extends keyof OutElem ? OutElem[K] : B; }, OutErr, OutDone, InElem, InErr, InDone, R>; <OutElem extends object, OutErr, OutDone, InElem, InErr, InDone, R, N extends string, B>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, R>, name: Exclude<N, keyof OutElem>, f: (a: NoInfer<OutElem>) => B): Channel<{ [K in N | keyof OutElem]: K extends keyof OutElem ? OutElem[K] : B; }, OutErr, OutDone, InElem, InErr, InDone, R>; }

Source

Since v4.0.0