All Projects → smnbbrv → ngx-rx-collector

smnbbrv / ngx-rx-collector

Licence: other
Angular 6+ garbage collector for RxJS subscriptions.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to ngx-rx-collector

ngrx-form
Reactive Forms bindings for NGRX and Angular
Stars: ✭ 46 (+206.67%)
Mutual labels:  angular2
ng-math
Math Flashcard Progressive Web App built with Angular 2
Stars: ✭ 17 (+13.33%)
Mutual labels:  angular2
ionic-workflow-guide
Create a full and powerful worflow with Ionic (Unit Testing, Environment variables, Automatic documentation, Production App Server, Automatic deployment)
Stars: ✭ 46 (+206.67%)
Mutual labels:  angular2
angular4-paystack
💵 An angular2+ module for paystack transactions
Stars: ✭ 51 (+240%)
Mutual labels:  angular2
openpics
Search and download free stock photos from multiple sources for your creative project
Stars: ✭ 31 (+106.67%)
Mutual labels:  angular2
login-form-angular2
A simple login form using the angular2 material design and the angular-CLI.
Stars: ✭ 21 (+40%)
Mutual labels:  angular2
BlazorHealthApp
Example application ported from Angular 2 to Blazor
Stars: ✭ 37 (+146.67%)
Mutual labels:  angular2
ng-seed
Simple Angular seed project with commonly used features.
Stars: ✭ 12 (-20%)
Mutual labels:  angular2
wikift
enterprise level wikift is open source wiki system.
Stars: ✭ 308 (+1953.33%)
Mutual labels:  angular2
ui-grid-angular2
ui-grid in Angular 2
Stars: ✭ 35 (+133.33%)
Mutual labels:  angular2
ngx-flickity
Angular2 component for https://flickity.metafizzy.co/
Stars: ✭ 28 (+86.67%)
Mutual labels:  angular2
ng-leaflet
Angular 2 component for Leaflet 1.x (WIP - Help Wanted)
Stars: ✭ 16 (+6.67%)
Mutual labels:  angular2
gro-light-automation
A raspberry pi project to automate hydroponics with relays and data sensors through a web application
Stars: ✭ 44 (+193.33%)
Mutual labels:  angular2
Angular2-RecordRTC
A demonstration of RecordRTC working with Angular 2
Stars: ✭ 38 (+153.33%)
Mutual labels:  angular2
ngx-event-modifiers
Event Modifiers for Angular Applications https://netbasal.com/implementing-event-modifiers-in-angular-87e1a07969ce
Stars: ✭ 14 (-6.67%)
Mutual labels:  angular2
angular-progress-http
[DEPRECATED] Use @angular/common/http instead
Stars: ✭ 43 (+186.67%)
Mutual labels:  angular2
ionic2-geofence
Ionic2 Geofencing Sample Project
Stars: ✭ 96 (+540%)
Mutual labels:  angular2
kathisto
📦 Server-side rendering for Javascript based web-apps
Stars: ✭ 17 (+13.33%)
Mutual labels:  angular2
ng2-STOMP-Over-WebSocket
STOMP Over WebSocket service for angular2
Stars: ✭ 35 (+133.33%)
Mutual labels:  angular2
general-angular
Realtime Angular Admin/CRUD Front End App
Stars: ✭ 24 (+60%)
Mutual labels:  angular2

Deprecated

Angular 2+ garbage collector for RxJS subscriptions.

Benefits:

  • Clean, beautiful code
  • One property for all component's observables

Installation

npm i -S ngx-rx-collector

For v1 and v2 see corresponding branches

Usage

Use the pipe-able operator untilDestroyed and pass there your component instance. That is pretty much it.

If you use AoT build (which is enabled by default) you must have at least empty ngOnDestroy on your component.

If you don't use AoT build then simply call ngxRxCollectorDisableAoTWarning() in your main.ts. No ngOnDestroy required in this case.

Example

AoT build + no ngOnDestroy logic:

import { Component } from '@angular/core';
import { Collectable } from 'ngx-rx-collector';
import { interval } from 'rxjs/observable/interval';

@Component({
  template: 'Ticking bomb'
})
export class TestpageComponent {

  ngOnInit() {
    interval(1000).pipe(untilDestroyed(this)).subscribe(console.log.bind(console));
  }

  ngOnDestroy() {}

}

Non-AoT build + no ngOnDestroy logic:

import { Component } from '@angular/core';
import { Collectable } from 'ngx-rx-collector';
import { interval } from 'rxjs/observable/interval';

@Component({
  template: 'Ticking bomb'
})
export class TestpageComponent {

  ngOnInit() {
    interval(1000).pipe(untilDestroyed(this)).subscribe(console.log.bind(console));
  }

}

Any build + ngOnDestroy logic:

import { Component } from '@angular/core';
import { Collectable } from 'ngx-rx-collector';
import { interval } from 'rxjs/observable/interval';

@Component({
  template: 'Ticking bomb'
})
export class TestpageComponent {

  ngOnInit() {
    interval(1000).pipe(untilDestroyed(this)).subscribe(console.log.bind(console));
  }

  ngOnDestroy() {
    console.log('destroyed')
  }

}

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].