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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@iworb/rxjs-utils

v0.0.6

Published

![](https://img.shields.io/badge/license-MIT-blue.svg)

Readme

RxjsUtils

Install

You could install this package with npm i @iworb/rxjs-utils or yarn add @iworb/rxjs-utils

Features

combineLatestMap

combineLatestMap<T>(sources: ObservableOrAnyMap<T>): Observable<T>

This function combines map of observables and constants to Object.

Example:

const intervalA = interval(500);
const intervalB = interval(1200).pipe(map((value) => value.toString()));
// This is Observable<{a: number, b: string, c: string}>
const ctx$ = combineLatestMap({
  a: intervalA,
  b: intervalB,
  c: 'constant string'
});
// Output:
// { a: 1, b: '1', c: 'constant string'}
// { a: 2, b: '1', c: 'constant string'}
// { a: 2, b: '2', c: 'constant string'}
// { a: 3, b: '2', c: 'constant string'}
// ...

download and performObservables, downloadWaterfall

function download<T>(
  name: string,
  http: HttpClient,
  requests: HttpRequest<T>[],
  options?: { concurrentCount?: number, retryOnError?: number }
): Observable<DownloadEvent<T>> { /* ... */ }

function performObservables<T>(
  name: string,
  observables: Observable<T>[],
  options?: { concurrentCount?: number, retryOnError?: number }
): Observable<DownloadEvent<T>> { /* ... */}

function downloadWaterfall<T, R>(
  name: string,
  createRequest: (payload?: R) => Observable<T[]>,
  nextStep: (payload?: R) => R,
  payload?: R,
  options?: { retryOnError?: number }
): Observable<DownloadEvent<T>> { /* ... */ }

This function allows you to perform multiple requests and gather all results with progress per each request.

If you have exact amount of requests - use download (or performObservables if you have requests as observables), otherwise, when you have to load page by page, use downloadWaterfall.

Examples:

const links = Array.from(
  { length: 20 },
  (v, i) => `https://jsonplaceholder.typicode.com/posts/${i + 1}`
);
const requests = links.map((link) =>
  new HttpRequest<Post>('GET', link)
);

const status1$ = performObservables(
  'posts',               // just a name for events
   this.links.map((link) => this.http.get<Post>(link)), // observables
  {concurrentCount: 5},  // 5 posts could be loaded at the same time
).subscribe();

const status2$ = download(
  'posts',               // just a name for events
  this.http,             // Angular HttpClient
  this.requests,         // List of requests
  {concurrentCount: 5},  // 5 posts could be loaded at the same time
).subscribe();
// return function because of bind issues
function getPosts(): (payload?: {skip?: number, take?: number}) => Observable<Post[]> {
  return (payload?: {skip?: number, take?: number}): Observable<Post[]> => {
    return this.http.get<Post[]>(
      `https://jsonplaceholder.typicode.com/posts?_start=${payload?.skip ?? 0}&_limit=${payload?.take ?? 5}`
  );
  }
}

// this function shows how we have to modify our payload to perform next request
function updatePayload(payload?: {skip?: number, take?: number}): {skip?: number, take?: number} {
  const take = payload?.take ?? 5;
  return {skip: (payload?.skip ?? 0) + take, take};
}

const status$ = downloadWaterfall(
  'posts',               // just a name for events
  this.getPosts(),       // function to get items based on payload
  this.updatePayload,    // function to update payload
).subscribe();

UntilDestroyedService

This service should be used to unsubscribe when component destroyed

Example:

@Component({
  selector: 'lib-test',
  template: '',
  providers: [UntilDestroyedService]
})
export class TestComponent {
  constructor(@Self() private destroyed$: UntilDestroyedService) {
    interval(500)
      .pipe(takeUntil(this.destroyed$))
      .subscribe((c) => console.log('count: ' + c));
  }
}

Demo

You could check an online demo of all features here.