Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/typeheim/rx-flow
Collection of reactive libraries to ease your life
https://github.com/typeheim/rx-flow
garbage-collection reactive-streams rxjs state state-machine state-management
Last synced: about 1 month ago
JSON representation
Collection of reactive libraries to ease your life
- Host: GitHub
- URL: https://github.com/typeheim/rx-flow
- Owner: typeheim
- License: mit
- Created: 2020-08-19T19:44:47.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-20T18:40:02.000Z (over 2 years ago)
- Last Synced: 2024-12-15T11:16:47.716Z (about 1 month ago)
- Topics: garbage-collection, reactive-streams, rxjs, state, state-machine, state-management
- Language: TypeScript
- Homepage:
- Size: 671 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxFlow
Collection of reactive libraries to ease your life
# 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
```shell
yarn add @typeheim/fire-rx
//or
npm -i @typeheim/fire-rx
```## Custom Obsevrables
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.```typescript
import { StatefulSubject } from '@typeheim/fire-rx'let subject = new StatefulSubject()
subject.next(5)
await subject // returns 5subject.next(6)
await subject // returns 6subject.stop() // completes subject and unsubscribe all subscriptions
```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.```typescript
class WithoutDestructor {
@StopOnDestroy()
valueSubject = new ValueSubject(1)@StopOnDestroy()
statefulSubject = new StatefulSubject()
}
```
[Read more about FireRx...](packages/fire-rx/README.md)