Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krawaller/callbag-start-with
https://github.com/krawaller/callbag-start-with
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/krawaller/callbag-start-with
- Owner: krawaller
- License: mit
- Created: 2018-02-14T10:53:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-25T22:00:36.000Z (almost 4 years ago)
- Last Synced: 2024-07-31T21:53:29.583Z (6 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-callbags - start-with
README
# callbag-start-with
[Callbag](https://github.com/callbag/callbag) operator that seeds a source with an initial data output. It works for both listenable and pullable sources.
`npm install callbag-start-with`
Every argument passed in will be emitted to the sink individually, so doing...
```
startWith(1,2,3)(source)
```...will make the source emit `1`, then `2`, then `3` before the "actual" emits.
## example
```js
const merge = require('callbag-merge');
const pipe = require('callbag-pipe');
const startWith = require('callbag-start-with');const actionStream = pipe(
merge(submitActions, editActions, someOtherActions, .... ),
startWith({type: "INIT"})
);
```