本文整理匯總了TypeScript中rxjs/Subject.Subject類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Subject類的具體用法?TypeScript Subject怎麽用?TypeScript Subject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Subject類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
this.image.onerror = (err) => {
this.imageLoadSubject.complete();
};
示例2: constructor
constructor(event: esriMouseEvent) {
super(event);
this._featureSubject = new Subject();
this.features = this._featureSubject.asObservable();
}
示例3:
.then((directoryUser:DirectoryUser) => {
this._sessionUser.isAdmin = directoryUser.isAdmin;
this.isSignedInSubject.next(true);
return this._sessionUser.hostedDomain === GoogleApplicationAccount.domain;
})
示例4:
this.get('assets/talks.json').subscribe((talks: Array<TalkModel>) => {
this.talks = talks;
talks.forEach((talk: TalkModel) => subject.next(talk));
subject.complete();
});
示例5:
.then(user => {
logger.debug('has authenticated user', user);
authState.next({ state: 'signedIn', user: user });
})
示例6: observe
observe(): Observable<any> {
return this._subject.asObservable();
}
示例7: onEnd
private onEnd(event: TransitionEvent | AnimationEvent): void {
if (!this.animationEnd.closed) {
this.animationEnd.next(event);
}
}
示例8: ngOnDestroy
ngOnDestroy(): void {
if (this.animationEnd && !this.animationEnd.closed) {
this.animationEnd.complete();
}
}