本文整理匯總了TypeScript中rxjs/ReplaySubject.ReplaySubject.next方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ReplaySubject.next方法的具體用法?TypeScript ReplaySubject.next怎麽用?TypeScript ReplaySubject.next使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rxjs/ReplaySubject.ReplaySubject
的用法示例。
在下文中一共展示了ReplaySubject.next方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: tabCreated
public tabCreated(tab: ITab) {
this.tabDictionary.setValue(tab.key, tab);
this.tabAdded.next(tab);
if (!this.active || tab.instantOpen) {
this.tabActivated.next(tab);
}
}
示例2: _updateUserProgramInCache
private async _updateUserProgramInCache(program: UserFacingProgram, resp: any): Promise<boolean> {
if (resp.result === 'updated' || resp.result === 'created') {
const cache = await this._cache.asObservable().take(1).toPromise();
const val = cache.find(p => p.guid === program.guid);
if (val) {
val.user = program;
this._cache.next(cache);
} else {
this._cache.next([{guid: program.guid, application: [], user: program}, ...cache]);
}
return true;
}
return false;
}
示例3: remove
public remove(key: string): void {
this.tabDictionary.remove(key);
this.tabRemoved.next(key);
if (this.active == key) {
this.activate(this.tabDictionary.keys[0]);
}
}
示例4:
.do( ([data, cache]) => {
let index = cache.findIndex(this._findProgram(data.guid));
if (index >= 0)
cache[index] = data;
this._cache.next(cache);
})
示例5: refreshProjection
public refreshProjection() {
if (this.mCanvas.width == this.mOldWidth && this.mCanvas.height == this.mOldHeight)
return;
this.createProjection(this.mCanvas.width, this.mCanvas.height);
this.mOldWidth = this.mCanvas.width;
this.mOldHeight = this.mCanvas.height;
this.mViewBoundsVersion++;
this.mSizeChanged$.next({ width: this.mOldWidth, height: this.mOldHeight });
}
示例6: it
it('Should notify errorneous execution', async () => {
const error = new Error('');
const observable = new ReplaySubject<Error | undefined>();
observable.next(error);
const notificationService = NotificationService.getInstance();
await notificationService.reportExecutionError('mock command', observable);
assert.calledOnce(mShow);
assert.notCalled(mShowInformation);
assert.notCalled(mShowWarningMessage);
assert.calledWith(mShowErrorMessage, 'mock command failed to run');
});