Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@typeheim/fire-rx

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typeheim/fire-rx

RxJS on steroids

  • 0.0.4
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

FireRx

FireRx extends RxJS with different useful features. Adds memory safety and garbage collection features to work with subjects and subscriptions, subjects that behave both like subjects and promises to support async/await and many more.

NPM Version Build Status Package License Discord

Getting Started

Install package

yarn add @typeheim/fire-rx
//or
npm -i @typeheim/fire-rx

Overview

FireRx consist of custom Observable types and additional features to work with observables.

Custom Observable Types

FireRx adds custom observable types, like StatefulSubject that acts as ReplaySubject and Promise so that you can use async/await operators on it as well as regular Subject methods. Adds memory safety and garbage collection automatically calling unsubscribe on subscriptions.

import { StatefulSubject } from '@typeheim/fire-rx'

let subject = new StatefulSubject<number>()

subject.next(5)  
await subject // returns 5

subject.next(6)
await subject // returns 6

subject.stop() // completes subject and unsubscribe all subscriptions

Read more about all custom observables...

Garbage Collection

FireRx provide set of features for garbage collection, like StopOnDestroy decorator for FireRx custom observables that extends Angular destructor(ngOnDestroy) or custom destructor (specified at decorator metadata) and stop specified observable.

class WithoutDestructor {
    @StopOnDestroy()
    valueSubject = new ValueSubject(1)

    @StopOnDestroy()
    statefulSubject = new StatefulSubject()
}

Read more about garbage collection...

Keywords

FAQs

Package last updated on 07 Sep 2020

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