MCPcopy Create free account
hub / github.com/effect-app/libs / findEffect

Function findEffect

repos/effect/packages/effect/src/Sink.ts:1493–1500  ·  view source on GitHub ↗
(
  predicate: (input: In) => Effect.Effect<boolean, E, R>
)

Source from the content-addressed store, hash-verified

1491 * @category constructors
1492 * @since 4.0.0
1493 */
1494export const find: {
1495 <In, Out extends In>(refinement: Refinement<In, Out>): Sink<Option.Option<Out>, In, In>
1496 <In>(predicate: Predicate<In>): Sink<Option.Option<In>, In, In>
1497} = <In>(predicate: Predicate<In>): Sink<Option.Option<In>, In, In> =>
1498 reduceWhile(
1499 Option.none<In>,
1500 Option.isNone,
1501 (acc, in_) => predicate(in_) ? Option.some(in_) : acc
1502 )
1503

Callers

nothing calls this directly

Calls 4

reduceWhileEffectFunction · 0.85
predicateFunction · 0.85
someMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…