Skip to content

SchweizS/rxjsx

 
 

Repository files navigation

RxJS Extensions

codeql Tests Status Coverage Status npm (scoped) Snyk Vulnerabilities for npm scoped package Run on Repl.it

🛠️ Install

npm install --save @rxjsx/rxjsx rxjs

🧑‍💻 Demo

import { of } from 'rxjs';
import { flatListMap } from '@rxjsx/rxjsx';

of([1, 2, 3], [4], [5, 6])
    .pipe(flatListMap(x => of(x, 10+x)))
    .subscribe(console.log);

You can experiment with the above code by forking this ReplIt repo or through this Medium article.

📓 Manual

The available operators so far are the following:

Operator Description
flatMap RxJS's mergeMap alias
zipMap To zip the transformed value with the original value
flatZipMap Similar to zipMap, but to be used when a transformation returns an observable
projectToFormer To project an observable of pairs, to get the first coordinate
projectToLatter To project an observable of pairs, to get the second coordinate
projectTo To project an observable of tuples
mapFormer To transform the first coordinate of an observable of pairs
mapLatter To transform the second coordinate of an observable of pairs
flatMapFormer Similar to mapFormer, but to work on stream-returning transformations
flatMapLatter Similar to mapLatter, but to work on stream-returning transformations
listMap To transform an observable of list, with a mapping on the list elements
flatListMap To transform an observable of list, with a stream-returning member transformation
listFlatMap To transform an observable of list, with a list-returning member transformation
flatListFlatMap To transform an observable of list, with a list-observable-returning transformation

💪 Thanks to all Contributors

List of Contributors

📚 Related Literature

⌨️ Contributing

🙏 Support

This project needs your support. Don't forget to leave a ⭐ behind.

About

RxJS Extension

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 95.8%
  • JavaScript 4.2%