Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Andarist/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.
https://github.com/Andarist/callbag-take-while
callbag callbags
Last synced: 18 days ago
JSON representation
👜 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.
- Host: GitHub
- URL: https://github.com/Andarist/callbag-take-while
- Owner: Andarist
- Created: 2018-08-04T18:42:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-09T14:15:47.000Z (almost 6 years ago)
- Last Synced: 2024-10-20T06:23:01.903Z (24 days ago)
- Topics: callbag, callbags
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-callbags - take-while
README
# 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
```js
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
}),
)
```