Hyperlinkv0.8.0-beta.28

Sink

Sink.takeUntilconsteffect/Sink.ts:1716
<In>(predicate: Predicate<In>): Sink<Array<In>, In, In>

Collects input elements until the predicate returns true, including the matching element in the result.

constructors
Source effect/Sink.ts:17169 lines
export const takeUntil = <In>(predicate: Predicate<In>): Sink<Array<In>, In, In> =>
  suspend(() => {
    let done = false
    return takeWhile((i) => {
      if (done) return false
      done = predicate(i)
      return true
    })
  })