本文整理汇总了TypeScript中rxjs/operators.timestamp函数的典型用法代码示例。如果您正苦于以下问题:TypeScript timestamp函数的具体用法?TypeScript timestamp怎么用?TypeScript timestamp使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了timestamp函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should completes without record stamp if source does not emits', () => {
const e1 = hot('---------|');
const e1subs = '^ !';
const expected = '---------|';
expectObservable(e1.pipe(timestamp(rxTestScheduler))).toBe(expected);
expectSubscriptions(e1.subscriptions).toBe(e1subs);
});
示例2: asDiagram
asDiagram('timestamp')('should record the time stamp per each source elements', () => {
const e1 = hot('-b-c-----d--e--|');
const e1subs = '^ !';
const expected = '-w-x-----y--z--|';
const expectedValue = { w: 10, x: 30, y: 90, z: 120 };
const result = e1.pipe(
timestamp(rxTestScheduler),
map(x => x.timestamp)
);
expectObservable(result).toBe(expected, expectedValue);
expectSubscriptions(e1.subscriptions).toBe(e1subs);
});