tapExit<X> method

ZIO<R, E, A> tapExit<X>(
  1. ZIO<R, E, X> f(
    1. Exit<E, A> _
    )
)

A variant of tap, passing the Exit value of this ZIO.

Implementation

ZIO<R, E, A> tapExit<X>(
  ZIO<R, E, X> Function(Exit<E, A> _) f,
) =>
    ZIO.from(
      (ctx) => race(ctx.signal.awaitIO.lift<R, E>()).unsafeRun(ctx).then(
            (exit) => f(exit)
                .unsafeRun(ctx.withoutSignal)
                .then((_) => _.call(exit)),
          ),
    );