0.2.0 • Published 2 years ago

@typeheim/fire-rx v0.2.0

Weekly downloads
14
License
MIT
Repository
-
Last release
2 years ago

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.

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.complete() // 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...

0.2.0

2 years ago

0.1.0

3 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0-beta.24

4 years ago

0.0.0-beta.19

4 years ago

0.0.0-beta.18

4 years ago

0.0.0-beta.17

4 years ago

0.0.0-beta.16

4 years ago

0.0.0-beta.15

4 years ago

0.0.0-beta.13

4 years ago

0.0.0-beta.12

4 years ago

0.0.0-beta.8

4 years ago

0.0.0-beta.6

4 years ago

0.0.0-beta-4

4 years ago

0.0.0-beta-3

4 years ago

0.0.0-beta.2

4 years ago

0.0.0-beta.1

4 years ago