*/@Injectable()exportclassMySharedService{ myData: BehaviorSubject<MyDataInterface> =newBehaviorSubject(null);constructor(private apiServie: ApiService) {this.apiService.getTestData().subscribe((response) =>{this.myData.next({ ...response.body });console.log(this.myData.getValue()); }); } ...
Rxjs与BehaviorSubject的奇怪问题 Angular RxJs BehaviorSubject未正确更新 值发出后的RxJS BehaviorSubject getValue不一致(在Jest中测试时) 来自switchMap的BehaviorSubject,则getValue不是函数错误 来自http调用的RxJS BehaviorSubject call请求 RxJS -不带订阅/ BehaviorSubject也一样?
private messageToQuoteSubject = new BehaviorSubject< StreamMessage<T> | undefined Expand Down Expand Up @@ -518,28 +514,6 @@ export class ChannelService< .pipe(shareReplay(1)); } /** * internal */ removeOldMessageFromMessageList() { const channel = this.activeChannelSubject.getValue(); ...
getValue()[sourceId]; return source && !(source.connectorId === 'sitemap' || (source.connectorId === 'folder' && source.permanentSync)); @@ -458,10 +446,11 @@ export class SyncService { } // METHODS FOR THE NEW SERVICE syncListCache = new BehaviorSubject<SyncBasicData[]>([])....
因此,我不得不在我的拦截方法中使用一个逻辑,对于刷新令牌中的任何请求,端点应该只具有没有访问令牌...
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; import { ActivatedRouteSnapshot, Router, RoutesRecognized, } from '@angular/router'; import { BehaviorSubject } from 'rxjs'; import { filter } from 'rxjs/operators'; import { Breadcrumb } from './types/breadcrumb'; @@...
您不订阅refreshPermissions函数。如果没有订阅,您的函数将不会被触发。