/** * Returns an effect that effectfully "peeks" at the failure or success of * this effect. * * @tsplus static effect/core/io/Effect.Aspects tapBoth * @tsplus pipeable effect/core/io/Effect tapBoth */ export function tapBoth( f: (e: E) => Effect, g: (a: A) => Effect ) { return (self: Effect): Effect => self.foldCauseEffect( (cause) => cause.failureOrCause.fold( (e) => f(e).zipRight(Effect.failCause(cause)), () => Effect.failCause(cause) ), (a) => g(a).as(a) ) }