rxjs-x
v0.0.3
Published
this project aim to auto free subscription
Downloads
3
Readme
RxjsX
Use decorator to auto free Subscription when component destroy
Example
import { AutoFree } from 'rxjs-x';
@AutoFree()
@Component({
selector: 'app-test',
template: ``,
})
export class TestComponent implements OnDestroy {
interval: Subscription = interval(2000).pipe().subscribe((num) => {
console.log('subscribe: ', num);
});
ngOnDestroy() {
console.log(this.interval);
}
}