Package: effect
Module: Sink
Creates a sink containing the first value matched by an effectful predicate.
When to use
Use when you need to run effects, fail, or use services while searching for the first matching input.
Details
Returns Option.some with the first input whose predicate result is true,
or Option.none if the upstream stream ends first. If the predicate effect
fails, the sink fails with the same error.
See
find for the synchronous predicate variantSignature
declare const findEffect: <In, E, R>(predicate: (input: In) => Effect.Effect<boolean, E, R>) => Sink<Option.Option<In>, In, In, E, R>
Since v2.0.0