angular2-take-until-destroy
Advanced tools
Comparing version 1.0.4 to 2.0.0
@@ -1,4 +0,7 @@ | ||
import { Subject } from "rxjs"; | ||
import { Subject } from 'rxjs/Subject'; | ||
export function TakeUntilDestroy(constructor) { | ||
var originalDestroy = constructor.prototype.ngOnDestroy; | ||
if (typeof originalDestroy !== 'function') { | ||
console.warn(constructor.name + " is using @TakeUntilDestroy but does not implement OnDestroy"); | ||
} | ||
constructor.prototype.componentDestroy = function () { | ||
@@ -5,0 +8,0 @@ this._takeUntilDestroy$ = this._takeUntilDestroy$ || new Subject(); |
@@ -1,2 +0,1 @@ | ||
import { TakeUntilDestroy } from "./angular2-take-until-destroy"; | ||
export default TakeUntilDestroy; | ||
export { TakeUntilDestroy } from "./angular2-take-until-destroy"; |
@@ -1,3 +0,2 @@ | ||
import { TakeUntilDestroy } from "./angular2-take-until-destroy"; | ||
export default TakeUntilDestroy; | ||
export { TakeUntilDestroy } from "./angular2-take-until-destroy"; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "angular2-take-until-destroy", | ||
"version": "1.0.4", | ||
"version": "2.0.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "description": "Add take until component destroy for easy unsubscribe when the component destroyed", |
@@ -1,4 +0,4 @@ | ||
# Angular 2 - easy unsubscribe when component destroyed | ||
# Angular 2+ - Unsubscribe for pros [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) | ||
##### Angular 2 decorator - easy and declarative way to unsubscribe from observables when the component destroyed | ||
##### Declarative way to unsubscribe from observables when the component destroyed | ||
@@ -10,3 +10,3 @@ ## Installation | ||
```js | ||
import TakeUntilDestroy from "angular2-take-until-destroy"; | ||
import { TakeUntilDestroy } from "angular2-take-until-destroy"; | ||
@@ -13,0 +13,0 @@ @Component({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3953
18