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

Function dropWhileEffectReader

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

Source from the content-addressed store, hash-verified

629
630/** @internal */
631const dropWhileEffectReader = <In, R, E>(
632 predicate: (input: In) => Effect.Effect<boolean, E, R>
633): Channel.Channel<Chunk.Chunk<In>, Chunk.Chunk<In>, E, E, unknown, unknown, R> =>
634 core.readWith({
635 onInput: (input: Chunk.Chunk<In>) =>
636 pipe(
637 input,
638 Effect.dropWhile(predicate),
639 Effect.map((leftover) => {
640 const more = leftover.length === 0
641 return more ?
642 dropWhileEffectReader(predicate) :
643 pipe(
644 core.write(Chunk.unsafeFromArray(leftover)),
645 channel.zipRight(channel.identityChannel<Chunk.Chunk<In>, E, unknown>())
646 )
647 }),
648 channel.unwrap
649 ),
650 onFailure: core.fail,
651 onDone: () => core.void
652 })
653
654/** @internal */
655export const ensuring = dual<

Callers 1

dropWhileEffectFunction · 0.85

Calls 3

pipeFunction · 0.70
mapMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected