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

Function repeatEffectChunkOption

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

Source from the content-addressed store, hash-verified

5257
5258/** @internal */
5259export const repeatEffectChunkOption = <A, E, R>(
5260 effect: Effect.Effect<Chunk.Chunk<A>, Option.Option<E>, R>
5261): Stream.Stream<A, E, R> =>
5262 unfoldChunkEffect(effect, (effect) =>
5263 pipe(
5264 Effect.map(effect, (chunk) => Option.some([chunk, effect] as const)),
5265 Effect.catchAll(Option.match({
5266 onNone: () => Effect.succeed(Option.none()),
5267 onSome: Effect.fail
5268 }))
5269 ))
5270
5271/** @internal */
5272export 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