Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Andarist/callbag-buffer
👜 Callbag operator which buffers source values until separator stream emits.
https://github.com/Andarist/callbag-buffer
callbag callbags
Last synced: 3 months ago
JSON representation
👜 Callbag operator which buffers source values until separator stream emits.
- Host: GitHub
- URL: https://github.com/Andarist/callbag-buffer
- Owner: Andarist
- Created: 2018-07-16T20:29:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-11T21:32:43.000Z (over 6 years ago)
- Last Synced: 2024-10-20T06:22:55.732Z (3 months ago)
- Topics: callbag, callbags
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-callbags - buffer
README
# callbag-buffer
Callbag operator which buffers source values until separator stream emits.
## Example
```js
import buffer from 'callbag-buffer'
import forEach from 'callbag-for-each'
import fromEvent from 'callbag-from-event'
import map from 'callbag-map'
import pipe from 'callbag-pipe'const btn = document.getElementById('#release')
pipe(
fromEvent(document, 'click'),
map(() => Math.floor(Math.random() * 100))
buffer(fromEvent(btn, 'click')),
forEach(values => {
console.log(values) // [86, 93, 57, 64] ...
})
)
```