Skip to content

👜 Callbag operator which emits values emitted by the source as long as each value satisfies the given predicate, and then completes as soon as predicate is not satisfied.

Notifications You must be signed in to change notification settings

Andarist/callbag-take-while

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

callbag-take-while

Callbag operator which emits values emitted by the source as long as each value satisfies the given predicate, and then completes as soon as predicate is not satisfied.

Example

import forEach from 'callbag-for-each'
import fromIter from 'callbag-from-iter'
import pipe from 'callbag-pipe'
import takeWhile from 'callbag-take-while'

pipe(
  fromIter([1, 2, 3, 4, 5]),
  takeWhile(i => i !== 4),
  forEach(value => {
    actual.push(value) // will log 1, 2, 3
  }),
)

About

👜 Callbag operator which emits values emitted by the source as long as each value satisfies the given predicate, and then completes as soon as predicate is not satisfied.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published