Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacobbubu/pull-tee
https://github.com/jacobbubu/pull-tee
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jacobbubu/pull-tee
- Owner: jacobbubu
- License: mit
- Created: 2020-03-29T01:14:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-10T01:35:57.000Z (over 1 year ago)
- Last Synced: 2024-11-13T16:12:00.501Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.13 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# @jacobbubu/pull-tee
[![Build Status](https://travis-ci.org/jacobbubu/pull-tee.svg)](https://travis-ci.org/jacobbubu/pull-tee)
[![Coverage Status](https://coveralls.io/repos/github/jacobbubu/pull-tee/badge.svg)](https://coveralls.io/github/jacobbubu/pull-tee)
[![npm](https://img.shields.io/npm/v/@jacobbubu/pull-tee.svg)](https://www.npmjs.com/package/@jacobbubu/pull-tee/)> Rewritten [pull-tee](https://github.com/dominictarr/pull-tee) in TypeScript.
# pull-tee
feed a pull-stream into multiple sinks
## example
```ts
import * as pull from 'pull-stream'
import tee from '../src'
import * as assert from 'assert'let a: number[] = []
let b: number[] = []pull(
pull.values([1, 2, 3, 4, 5]),
tee(
pull.collect((_, _a: number[]) => {
a = _a
if (b.length > 0 && a.length > 0) assert.deepEqual(a, b)
})
),
pull.collect((_, _b: number[]) => {
b = _b
if (b.length > 0 && a.length > 0) assert.deepEqual(a, b)
})
)console.log(a, b)
```