/** * Returns the specified stream if the specified effectful condition is * satisfied, otherwise returns an empty stream. * * @tsplus static effect/core/stream/Stream.Ops whenEffect */ export function whenEffect( b: Effect, stream: Stream ): Stream { return Stream.fromEffect(b).flatMap((b) => (b ? stream : Stream.empty)) }