本文整理匯總了TypeScript中rxjs.BehaviorSubject.asObservable方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript BehaviorSubject.asObservable方法的具體用法?TypeScript BehaviorSubject.asObservable怎麽用?TypeScript BehaviorSubject.asObservable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rxjs.BehaviorSubject
的用法示例。
在下文中一共展示了BehaviorSubject.asObservable方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: readOnlyNotes
get readOnlyNotes(): Observable<Note[]> {
return this._readOnlyNotes.asObservable();
}
示例2: editableNotes
get editableNotes(): Observable<Note[]> {
return this._editableNotes.asObservable();
}
示例3: allNotes
get allNotes(): Observable<Note[]> {
return this._allNotes.asObservable();
}
示例4: myNotes
get myNotes(): Observable<Note[]> {
return this._myNotes.asObservable();
}
示例5: asObservable
asObservable() {
return this._subject.asObservable();
}
示例6: getObs
function getObs(): Observable<string> {
setTimeout(() => subject$.next("next " + i), 2000);
i++;
return subject$.asObservable();
}
示例7: BehaviorSubject
).subscribe((urlService: NewUrlStateNotificationService) => {
const view = urlService.getStartPath();
this.outGutterResized = new BehaviorSubject(this.splitRatioService.getSplitRatio(view));
this.onGutterResized$ = this.outGutterResized.asObservable();
});
示例8: constructor
constructor() { //private http: HttpClient
this.currentUserSubject = new BehaviorSubject<User>(JSON.parse(localStorage.getItem('currentUser')));
this.currentUser = this.currentUserSubject.asObservable();
}
示例9: getState
// I get the current state as a stream (will always emit the current state value as
// the first item in the stream).
public getState() : Observable<StateType> {
return( this.stateSubject.asObservable() );
}
示例10: constructor
constructor(private authService: AuthService, private router: Router) {
this.currentUserSubject = new BehaviorSubject<User>(JSON.parse(localStorage.getItem('currentUser')));
this.currentUser = this.currentUserSubject.asObservable();
}