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

Function dropUntilEffectReader

packages/effect/src/internal/sink.ts:582–603  ·  view source on GitHub ↗
(
  predicate: (input: In) => Effect.Effect<boolean, E, R>
)

Source from the content-addressed store, hash-verified

580
581/** @internal */
582const dropUntilEffectReader = <In, R, E>(
583 predicate: (input: In) => Effect.Effect<boolean, E, R>
584): Channel.Channel<Chunk.Chunk<In>, Chunk.Chunk<In>, E, E, unknown, unknown, R> =>
585 core.readWith({
586 onInput: (input: Chunk.Chunk<In>) =>
587 pipe(
588 input,
589 Effect.dropUntil(predicate),
590 Effect.map((leftover) => {
591 const more = leftover.length === 0
592 return more ?
593 dropUntilEffectReader(predicate) :
594 pipe(
595 core.write(Chunk.unsafeFromArray(leftover)),
596 channel.zipRight(channel.identityChannel<Chunk.Chunk<In>, E, unknown>())
597 )
598 }),
599 channel.unwrap
600 ),
601 onFailure: core.fail,
602 onDone: () => core.void
603 })
604
605/** @internal */
606export const dropWhile = <In>(predicate: Predicate<In>): Sink.Sink<unknown, In, In> =>

Callers 1

dropUntilEffectFunction · 0.85

Calls 3

pipeFunction · 0.70
mapMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected