How to Create New RxJS Operators
Creating reusable RxJS operators with RxJSx: transform arrays and tuples, retain original values, and compose observable pipelines in TypeScript.
Talk Deliveries
November 9, 2024
Nuremberg, Germany
RxJSx (@rxjsx/rxjsx) extends RxJS with operators for arrays and tuples. It provides practical examples of packaging reusable transformations as operators, including keeping an original value available after a later asynchronous operation.
Operators to explore
zipMapandflatZipMap: pair an original value with its transformation; the latter handles transformations that return an observable.mapFormerandmapLatter: transform individual coordinates of a pair.projectToFormer,projectToLatter, andprojectTo: select values from tuples.listMapandflatListMap: transform array elements, including transformations that return observables.
Further reading and source code
- RxJSx source code and operator documentation
- 13 Handy RxJS Operators: To Deal with Arrays and Tuples, by Mohammad-Ali A'RÂBI, published in ITNEXT on March 16, 2021.
