Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krawaller/callbag-merge-with
https://github.com/krawaller/callbag-merge-with
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/krawaller/callbag-merge-with
- Owner: krawaller
- License: mit
- Created: 2018-02-15T21:15:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-23T07:39:37.000Z (over 6 years ago)
- Last Synced: 2024-09-17T00:18:32.438Z (4 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-callbags - merge-with
README
# callbag-merge-with
[Callbag](https://github.com/callbag/callbag) operator version of [callback-merge](https://github.com/staltz/callbag-merge). Useful for example when you want to merge the current source with other(s) in the middle of a pipe.
`npm install callbag-merge-with`
## example
```js
const fromEvent = require('callbag-from-event');
const pipe = require('callbag-pipe');
const filter = require('callbag-filter');
const mergeWith = require('callbag-merge-with');
const mapTo = require('callbag-map-to');const submitActions = pipe(
fromEvent(inputNode, 'keyup'),
filter(e => e.key === 'Enter'),
mergeWith(fromEvent(submitBtn, 'click')),
mapTo({type: 'submit'})
);
```