本文整理汇总了TypeScript中rxjs.Subject.unsubscribe方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Subject.unsubscribe方法的具体用法?TypeScript Subject.unsubscribe怎么用?TypeScript Subject.unsubscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rxjs.Subject
的用法示例。
在下文中一共展示了Subject.unsubscribe方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
e1.subscribe((x: string) => {
if (x === 'd' && !skip.closed) {
skip.next('x');
}
skip.unsubscribe();
});
示例2: destroy
destroy(): void {
this._disposer.unsubscribe();
this._isOpeningMap.clear();
this._obs = null;
this._emitter.unsubscribe();
this._driver.destroy();
}
示例3:
unsubscribe: () => {
suspended = true;
if (scheduler) {
scheduler.unsubscribe();
}
scheduler = null;
source = null;
$timeout.cancel(pendingRun);
document.removeEventListener('visibilitychange', watchDocumentVisibility);
$window.removeEventListener('offline', suspendScheduler);
$window.removeEventListener('online', resumeScheduler);
},
示例4:
public $onDestroy() {
this.alarmUpdated.unsubscribe();
}
示例5: it
it('should not report errors to a closed subject', () => {
const subject = new Subject<{}>();
subject.unsubscribe();
expect(canReportError(subject)).to.be.false;
});
示例6: ngOnDestroy
/**
* On Destroy
*/
ngOnDestroy(): void {
this.params$.complete();
this.params$.unsubscribe();
}
示例7: destroy
destroy(): void {
this._subject.unsubscribe();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this._subject = null as any;
}