angular2-take-until-destroy
Advanced tools
Comparing version
@@ -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 [](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
3953
8.54%18
5.88%