本文整理汇总了TypeScript中rxjs/operators.onErrorResumeNext函数的典型用法代码示例。如果您正苦于以下问题:TypeScript onErrorResumeNext函数的具体用法?TypeScript onErrorResumeNext怎么用?TypeScript onErrorResumeNext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了onErrorResumeNext函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should not continue with observble does not ends', () => {
const source = hot('--');
const next1 = cold( '-a--b-');
const subs = '^ ';
const expected = '-';
expectObservable(source.pipe(onErrorResumeNext(next1))).toBe(expected);
expectSubscriptions(source.subscriptions).toBe(subs);
});
开发者ID:MykhailoIskiv,项目名称:rxjs,代码行数:9,代码来源:onErrorResumeNext-spec.ts
示例2: asDiagram
asDiagram('onErrorResumeNext')('should continue observable sequence with next observable', () => {
const source = hot('--a--b--#');
const next = cold( '--c--d--|');
const subs = '^ !';
const expected = '--a--b----c--d--|';
expectObservable(source.pipe(onErrorResumeNext(next))).toBe(expected);
expectSubscriptions(source.subscriptions).toBe(subs);
});
开发者ID:MykhailoIskiv,项目名称:rxjs,代码行数:9,代码来源:onErrorResumeNext-spec.ts
示例3: it
it('should stop listening to a synchronous observable when unsubscribed', () => {
const sideEffects: number[] = [];
const synchronousObservable = concat(
defer(() => {
sideEffects.push(1);
return of(1);
}),
defer(() => {
sideEffects.push(2);
return of(2);
}),
defer(() => {
sideEffects.push(3);
return of(3);
})
);
throwError(new Error('Some error')).pipe(
onErrorResumeNext(synchronousObservable),
takeWhile((x) => x != 2) // unsubscribe at the second side-effect
).subscribe(() => { /* noop */ });
expect(sideEffects).to.deep.equal([1, 2]);
});
开发者ID:jaychsu,项目名称:RxJS,代码行数:24,代码来源:onErrorResumeNext-spec.ts
示例4: higherOrder
export function onErrorResumeNext<T, R>(this: Observable<T>, ...nextSources: Array<ObservableInput<any> |
Array<ObservableInput<any>> |
((...values: Array<any>) => R)>): Observable<R> {
return higherOrder(...nextSources)(this);
}
开发者ID:DallanQ,项目名称:rxjs,代码行数:5,代码来源:onErrorResumeNext.ts
注:本文中的rxjs/operators.onErrorResumeNext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论