本文整理匯總了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;
}