Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gianlucaguarini/erre.merge
Erre plugin to merge the results multiple streams into one
https://github.com/gianlucaguarini/erre.merge
Last synced: about 1 month ago
JSON representation
Erre plugin to merge the results multiple streams into one
- Host: GitHub
- URL: https://github.com/gianlucaguarini/erre.merge
- Owner: GianlucaGuarini
- License: mit
- Created: 2017-12-26T15:17:20.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-09-22T21:30:16.000Z (about 1 year ago)
- Last Synced: 2024-10-05T11:54:51.330Z (about 2 months ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# erre.merge
[erre](https://github.com/GianlucaGuarini/erre) plugin to merge the results multiple streams into one
[![Build Status][ci-image]][ci-url]
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![MIT License][license-image]][license-url]## Installation
```sh
npm i erre.merge -S
```## Usage
```js
import merge from 'erre.merge'
import erre from 'erre'erre.install('merge', merge)
const stream1 = erre(val => val + 1)
const stream2 = erre(val => val * 2)
const stream = erre.merge(stream1, stream2)stream.on.value(([val1, val2]) => {
console.log(val1, val2) // 3, 8
})stream1.push(2)
stream2.push(4)
```[ci-image]: https://img.shields.io/github/actions/workflow/status/gianlucaguarini/erre.merge/test.yml?style=flat-square
[ci-url]: https://github.com/gianlucaguarini/erre.merge/actions
[license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]: LICENSE
[npm-version-image]: http://img.shields.io/npm/v/erre.merge.svg?style=flat-square
[npm-downloads-image]: http://img.shields.io/npm/dm/erre.merge.svg?style=flat-square
[npm-url]: https://npmjs.org/package/erre.merge## API
### merge
Create a single stream merging multiple erre streams
**Parameters**
- `streams` **...Generator** [erre streams generators]((https://github.com/GianlucaGuarini/erre#stream))
Returns **Generator** a [new erre stream generator]((https://github.com/GianlucaGuarini/erre#stream))