JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 370
  • Score
    100M100P100Q96838F
  • License MIT

Useful utilities for RxJS

Package Exports

  • @rxjs-ninja/rxjs-utility

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rxjs-ninja/rxjs-utility) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

RxJS Ninja - Utilities

The RXJS Ninja Logo

rxjs-utility

Website | API Documentation | Changelog

@rxjs-ninja/rxjs-utility provides operators for working with Observable values to view them, and modify them and don't all into the other module categories.

Function and Operator categories

  • HTTP - Functions for working with HTTP Observables
  • Mapping - Operators use for mapping to different values
  • Side Effects - Operators for handling side effects
  • Streams - Operators and Functions for working with other types of streams of data

For example, using the Side Effects category:

import { fromEvent } from 'rxjs';
import { startWithTap, tapIf, tapOnSubscribe } from '@rxjs-ninja/rxjs-utility';

const inputObs$ = fromEvent(document, 'click').pipe(
  startWithTap(() => console.log('This will only fire once')),
  tapOnSubscribe(() => console.log('This will tab on every subscribe')),
  tapIf(
    (event) => event.target.id === 'some-div',
    () => console.log('This will tap if the user clicks on the target element'),
  ),
);

inputObs$.subscribe(); // This will only fire once, This will tab on every subscribe
inputObs$.subscribe(); // This will tab on every subscribe