// ets_tracing: off import type * as T from "../../../../Effect/index.js" import type * as C from "../core.js" import * as Chain from "./chain.js" import * as Empty from "./empty.js" import * as FromEffect from "./fromEffect.js" /** * Returns this stream if the specified condition is satisfied, otherwise returns an empty stream. */ export function whenEffect_( self: C.Stream, b: T.Effect ): C.Stream { return Chain.chain_(FromEffect.fromEffect(b), (_) => (_ ? self : Empty.empty)) } /** * Returns this stream if the specified condition is satisfied, otherwise returns an empty stream. * * @ets_data_first whenEffect_ */ export function whenEffect(b: T.Effect) { return (self: C.Stream) => whenEffect_(self, b) }