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

Function reduce

repos/effect/packages/effect/src/Sink.ts:1358–1364  ·  view source on GitHub ↗
(initial: LazyArg<S>, f: (s: S, input: In) => S)

Source from the content-addressed store, hash-verified

1356 */
1357export const reduceWhileArrayEffect = <S, In, E, R>(
1358 initial: LazyArg<S>,
1359 predicate: Predicate<S>,
1360 f: (s: S, input: NonEmptyReadonlyArray<In>) => Effect.Effect<S, E, R>
1361): Sink<S, In, never, E, R> =>
1362 fromTransform((upstream) => {
1363 let state = initial()
1364 if (!predicate(state)) {
1365 return Effect.succeed([state] as const)
1366 }
1367 return upstream.pipe(

Callers 3

Schedule.tsFile · 0.70
trie.tsFile · 0.50
compactFunction · 0.50

Calls 2

reduceArrayFunction · 0.85
fFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…