npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rxjsx/rxjsx

v1.0.0

Published

RxJS Extensions

Downloads

597

Readme

RxJS Extensions

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

RxJS operators to deal with arrays, tuples, and dragging the original values along while adding more values to the pipeline.

:hammer_and_wrench: Install

npm install --save @rxjsx/rxjsx rxjs

:technologist: 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.

:open_book: Examples

// instead of this
of([1, 2, 3]).pipe(map(l => l.map(e => e * 2))

// you can do this
of([1, 2, 3]).pipe(listMap(e => e * 2)) // [2, 4, 6]
// instead of this
let device;
deviceService.getDevice(id)
  .pipe(tap(_device => device = _device))
  .pipe(flatMap(_device => userService.getUser(device.owner)))
  .pipe(map(_user => userService.unassignDevice(_user, _device)))

// you can do this
deviceService.getDevice(id)
  .pipe(flatZipMap(device => userService.getUser(device.owner)))
  .pipe(map(([device, user]) => userService.unassignDevice(user, device)))

:notebook: Manual

The available operators so far are the following:

Operator | Description | --- | --- | flatMap / mergeMap | RxJS's mergeMap alias | zipMap | To zip the transformed value with the original value | flatZipMap / mergeZipMap | 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 / mergeMapFormer | Similar to mapFormer, but to work on stream-returning transformations | flatMapLatter / mergeMapLatter | 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 / mergeListMap | 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 / mergeListFlatMap | To transform an observable of list, with a list-observable-returning transformation|

:muscle: Thanks to all Contributors

List of Contributors

:books: Related Literature

:keyboard: Contributing

:pray: Support

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