/** * Returns a new effect that repeats this effect according to the specified * schedule or until the first failure, at which point, the failure value and * schedule output are passed to the specified handler. * * Scheduled recurrences are in addition to the first execution, so that * `io.repeat(Schedule.once)` yields an effect that executes `io`, and then if * that succeeds, executes `io` an additional time. * * @tsplus static effect/core/io/Effect.Aspects repeatOrElse * @tsplus pipeable effect/core/io/Effect repeatOrElse */ export function repeatOrElse( schedule: Schedule, orElse: (e: E, option: Maybe) => Effect ) { return (self: Effect): Effect => Effect.$.repeatOrElseEither(schedule, orElse)(self).map((either) => either.merge) }