Hyperlinkv0.8.0-beta.28

Channel

Channel.provideContextconsteffect/Channel.ts:7190
<R2>(context: Context.Context<R2>): <
  OutElem,
  OutErr,
  OutDone,
  InElem,
  InErr,
  InDone,
  Env
>(
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
) => Channel<
  OutElem,
  OutErr,
  OutDone,
  InElem,
  InErr,
  InDone,
  Exclude<Env, R2>
>
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
  context: Context.Context<R2>
): Channel<
  OutElem,
  OutErr,
  OutDone,
  InElem,
  InErr,
  InDone,
  Exclude<Env, R2>
>

Provides a Context to the channel, removing the corresponding service requirements from the returned channel.

services
Source effect/Channel.ts:719020 lines
export const provideContext: {
  <R2>(
    context: Context.Context<R2>
  ): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
    self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
  ) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, R2>>
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(
    self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
    context: Context.Context<R2>
  ): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, R2>>
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
  context: Context.Context<R2>
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, R2>> =>
  fromTransform((upstream, scope) =>
    Effect.map(
      Effect.provideContext(toTransform(self)(upstream, scope), context),
      Effect.provideContext(context)
    )
  ))
Referenced by 3 symbols