Hyperlinkv0.8.0-beta.28

Effect

Effect.bindToconsteffect/Effect.ts:1269
<N extends string>(name: N): <A, E, R>(
  self: Effect<A, E, R>
) => Effect<{ [K in N]: A }, E, R>
<A, E, R, N extends string>(self: Effect<A, E, R>, name: N): Effect<
  { [K in N]: A },
  E,
  R
>

Gives a name to the success value of an Effect, creating a single-key record used in do notation pipelines.

When to use

Use to start a do-notation pipeline from an existing Effect when its success value should become the first named field in the accumulated record.

do notationDobind
Source effect/Effect.ts:12694 lines
export const bindTo: {
  <N extends string>(name: N): <A, E, R>(self: Effect<A, E, R>) => Effect<{ [K in N]: A }, E, R>
  <A, E, R, N extends string>(self: Effect<A, E, R>, name: N): Effect<{ [K in N]: A }, E, R>
} = internal.bindTo