MCPcopy Index your code
hub / github.com/Effect-TS/effect / repeatEffectChunkOption

Function repeatEffectChunkOption

packages/effect/src/internal/stream.ts:5221–5231  ·  view source on GitHub ↗
(
  effect: Effect.Effect<Chunk.Chunk<A>, Option.Option<E>, R>
)

Source from the content-addressed store, hash-verified

5219
5220/** @internal */
5221export const repeatEffectChunkOption = <A, E, R>(
5222 effect: Effect.Effect<Chunk.Chunk<A>, Option.Option<E>, R>
5223): Stream.Stream<A, E, R> =>
5224 unfoldChunkEffect(effect, (effect) =>
5225 pipe(
5226 Effect.map(effect, (chunk) => Option.some([chunk, effect] as const)),
5227 Effect.catchAll(Option.match({
5228 onNone: () => Effect.succeed(Option.none()),
5229 onSome: Effect.fail
5230 }))
5231 ))
5232
5233/** @internal */
5234export const repeatEffectOption = <A, E, R>(effect: Effect.Effect<A, Option.Option<E>, R>): Stream.Stream<A, E, R> =>

Callers 2

repeatEffectChunkFunction · 0.85
repeatEffectOptionFunction · 0.85

Calls 3

unfoldChunkEffectFunction · 0.85
pipeFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…