repeatWhile method

ZIO<R, E, A> repeatWhile(
  1. bool predicate(
    1. A _
    )
)

Repeat this ZIO while the given predicate is true.

Implementation

ZIO<R, E, A> repeatWhile(
  bool Function(A _) predicate,
) =>
    flatMap((_) => predicate(_) ? repeatWhile(predicate) : ZIO.succeed(_));