New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rnjs

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rnjs

Reactive Programming Library for TypeScript/JavaScript

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

RN

Reactive Programming Library for TypeScript

glitch-less & hot Observable only RxJS

Usage

  • installation
npm install rnjs
  • import
import { RN, interval } from 'rnjs'

const a: RN<number> = interval(1000, true);  // generate RN

a.subscribe( console.log );

// 0
// 1
// 2
// ...

features

  • glitch-less

    • about "glitch"
      • RX GLITCHES AREN'T ACTUALLY A PROBLEM
      • Bainomugisha, Engineer, et al. "A survey on reactive programming." ACM Computing Surveys (CSUR) 45.4 (2013): 52.
    • all tasks are processed by priority-queue
  • has initial value

    • all RN always has initial value
    • you can get the current value by value property (like BehaviorSubject in RxJS)
        import { RN, interval } from 'rnjs'
    
        const a: RN<number> = interval(1000, true).take(8);
    
        a.subscribe( console.log );
    
        // |0---1---2---3---4---5---6---7---|
        //                ^
        setTimeout( () => console.log( a.value ), 3500 );  // 3
    
        // |0---1---2---3---4---5---6---7---|
        //                        ^
        setTimeout( () => console.log( a.value ), 5500 );  // 5
    
  • hot-RN(Observable) only

    • no cold/hot conversions are needed
    • all subscriber of an RN gets the same value at the same time
  • is compatible with RxJS

    • RN has interconversion methods (toObservable, fromObservable)
    • RN has the same subscribe API as RxJS -> can be used in Angular async pipe without conversion to RxJS Observable

Coresspondence tables to RxJS

  • Source RNs
RNRxJS v6
intervalinterval
fromEventfromEvent
fromPromisefrom
fromObservable-
manualBehaviorSubject
  • Combination methods
RNRxJS v6
combinecombineLatest
mergemerge
-concat
-zip
  • Operators
RNRxJS v6
debouncedebounceTime
filterfilter
flatMapflatMap
mapmap
mapTomapTo
pairwisepairwise
pluckpluck
scanscan
skipskip
skipAlreadyAppeareddistinct
skipUnchangeddistinctUntilChanged
skipWhileskipWhile
switchMapswitchMap
taketake
takeWhiletakeWhile
withLatestwithLatestFrom
withTimestamptimestamp
-startWith

Keywords

FAQs

Package last updated on 14 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc