ZIO<R, E, A>.layer constructor

ZIO<R, E, A>.layer(
  1. Layer<E, A> layer
)

Access a Layer and return the resulting service. If the Layer has already been accessed or provided with provideLayer, the cached value will be used.

Implementation

factory ZIO.layer(Layer<E, A> layer) =>
    ZIO.from((ctx) => ctx.accessLayer<E, A>(layer).unsafeRun(ctx));