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

ngx-auto-unsubscribe

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-auto-unsubscribe

Class decorator that will automatically unsubscribe from observables and events

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
decreased by-57.02%
Maintainers
0
Weekly downloads
 
Created
Source

Angular - Auto unsubscribe

Class decorator that will automatically unsubscribe from observables and events when the component destroyed

Installation

npm install ngx-auto-unsubscribe --save

Usage

import { AutoUnsubscribe } from "ngx-auto-unsubscribe";

@Component({
  selector: 'inbox'
})
@AutoUnsubscribe(blacklist = [])
export class InboxComponent {
  one$;
  two$;
  three;
  
  constructor( private store: Redux, private renderer: Renderer, private element : ElementRef ) {}
  
  ngOnInit() {
    this.one$ = store.select("data").subscribe(data => // do something);
    this.two$ = Observable.interval.subscribe(data => // do something);
    this.three = this.renderer.listen(this.element.nativeElement, this.event, e => // do something)
  }
}

FAQs

Package last updated on 11 Apr 2017

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