https://github.com/tim-smart/rxjs-iterable
https://github.com/tim-smart/rxjs-iterable
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tim-smart/rxjs-iterable
- Owner: tim-smart
- Created: 2021-01-02T20:15:40.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-03-10T23:42:52.000Z (over 4 years ago)
- Last Synced: 2025-08-09T12:44:39.944Z (10 months ago)
- Language: TypeScript
- Size: 83 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# rxjs-iterable
Create observables from iterables with backpressure support.
## Usage
```typescript
import * as Fs from "fs";
import * as RxOp from "rxjs/operators";
import * as RxI from "rxjs-iterable";
const CONCURRENCY = 2;
const [file$, push] = RxI.from(Fs.createReadStream(process.argv[2]), {
// How many chunks of data do we want to initially consume?
initialCount: CONCURRENCY,
});
file$
.pipe(
RxOp.map((b) => b.toString()),
// Call push to indicate we are ready to consume more data
RxOp.tap(push),
)
.subscribe(console.log);
```