Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Andarist/callbag-drop-after
👜 Callbag operator that drops all events after the first event for which predicate returns true.
https://github.com/Andarist/callbag-drop-after
callbag callbags
Last synced: 3 months ago
JSON representation
👜 Callbag operator that drops all events after the first event for which predicate returns true.
- Host: GitHub
- URL: https://github.com/Andarist/callbag-drop-after
- Owner: Andarist
- Created: 2018-05-04T10:09:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-11T19:58:49.000Z (over 6 years ago)
- Last Synced: 2024-10-20T06:23:11.793Z (3 months ago)
- Topics: callbag, callbags
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-callbags - drop-after
README
# callbag-drop-after
Callbag operator that drops all events after the first event for which predicate returns `true`.
Inspired by [most.js's skipAfter](https://mostcore.readthedocs.io/en/latest/api.html#skipafter).
## Example
```js
import dropAfter from 'callbag-drop-after'
import forEach from 'callbag-for-each'
import fromIter from 'callbag-from-iter'
import pipe from 'callbag-pipe'pipe(
fromIter([10, 20, 30, 40, 50, 60, 70]),
dropAfter(value => value >= 30),
forEach(value => {
// will log 10, 20, 30
console.log(value)
}),
)
```