Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krawaller/callbag-sample-combine
https://github.com/krawaller/callbag-sample-combine
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/krawaller/callbag-sample-combine
- Owner: krawaller
- License: mit
- Created: 2018-02-21T07:51:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-23T08:16:38.000Z (over 6 years ago)
- Last Synced: 2024-11-22T19:43:48.919Z (about 2 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-callbags - sample-combine
README
# callbag-sample-combine
[Callbag](https://github.com/callbag/callbag) operator behaving exactly like [callbag-sample](https://github.com/staltz/callbag-sample) by [André Staltz](https://staltz.com/) except the return source emits *both* the original listenable and the sampled pullable values together.
`npm install callbag-sample-combine`
## example
```js
const sampleCombine = require('callbag-sample-combine');
const fromIter = require('callbag-from-iter');
const fromInterval = require('callbag-interval');
const forEach = require('callbag-for-each');const listenable = fromInterval(1000);
const pullable = fromIter(['foo', 'bar', 'baz']);const source = sampleCombine(pullable)(listenable);
const sink = forEach(d => console.log(d));source(0, sink); // [1, 'foo']
// [2, 'bar']
// [3, 'baz']
```