本文整理汇总了TypeScript中rxjs/operators.merge函数的典型用法代码示例。如果您正苦于以下问题:TypeScript merge函数的具体用法?TypeScript merge怎么用?TypeScript merge使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了merge函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should merge never and throw', () => {
const e1 = cold('-');
const e1subs = '(^!)';
const e2 = cold('#');
const e2subs = '(^!)';
const result = e1.pipe(merge(e2, rxTestScheduler));
expectObservable(result).toBe('#');
expectSubscriptions(e1.subscriptions).toBe(e1subs);
expectSubscriptions(e2.subscriptions).toBe(e2subs);
});
示例2: asDiagram
asDiagram('merge')('should handle merging two hot observables', () => {
const e1 = hot('--a-----b-----c----|');
const e1subs = '^ !';
const e2 = hot('-----d-----e-----f---|');
const e2subs = '^ !';
const expected = '--a--d--b--e--c--f---|';
const result = e1.pipe(merge(e2, rxTestScheduler));
expectObservable(result).toBe(expected);
expectSubscriptions(e1.subscriptions).toBe(e1subs);
expectSubscriptions(e2.subscriptions).toBe(e2subs);
});