本文整理汇总了TypeScript中most.Sink类的典型用法代码示例。如果您正苦于以下问题:TypeScript Sink类的具体用法?TypeScript Sink怎么用?TypeScript Sink使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Sink类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: catch
export function tryEvent<T> (t: number, x: T, sink: Sink<T>) {
try {
sink.event(t, x);
} catch (e) {
sink.error(t, e);
}
}
示例2: run
run (sink: Sink<Location>, scheduler: Scheduler) {
const push = (l: Location) => sink.event(scheduler.now(), l);
const unlisten = this.history.listen(push);
return {
dispose () {
unlisten();
sink.end(scheduler.now());
}
};
}
示例3:
export function pushEvents<T> (buffer: any[], sink: Sink<T>) {
for (let i = 0; i < buffer.length; ++i) {
const {time, value} = buffer[i];
sink.event(time, value);
}
}
示例4: event
event(t: number, x: any) {
if (this.sink === void 0) {
return;
}
this.ensureActive();
this.sink.event(t, x);
}
示例5:
const push = (l: Location) => sink.event(scheduler.now(), l);