MCPcopy Create free account
hub / github.com/Effect-TS/effect / forEachArray

Function forEachArray

packages/effect/src/Sink.ts:1829–1838  ·  view source on GitHub ↗
(
  f: (input: NonEmptyReadonlyArray<In>) => Effect.Effect<X, E, R>
)

Source from the content-addressed store, hash-verified

1827 * @since 4.0.0
1828 */
1829export const forEachArray = <In, X, E, R>(
1830 f: (input: NonEmptyReadonlyArray<In>) => Effect.Effect<X, E, R>
1831): Sink<void, In, never, E, R> =>
1832 fromTransform((upstream) =>
1833 upstream.pipe(
1834 Effect.flatMap(f),
1835 Effect.forever({ disableYield: true }),
1836 Pull.catchDone(() => endVoid)
1837 )
1838 )
1839
1840/**
1841 * Runs an effectful function for each input element while it returns `true`.

Callers 2

fromPubSubFunction · 0.85
forEachFunction · 0.85

Calls 2

fromTransformFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected