本文整理汇总了TypeScript中rx.Observable.timer方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Observable.timer方法的具体用法?TypeScript Observable.timer怎么用?TypeScript Observable.timer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx.Observable
的用法示例。
在下文中一共展示了Observable.timer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: create
// We will simulate it too with a timer
private create(text: string) {
Observable.timer(1000)
.take(1)
.subscribe(() => {
this.todos = this.todos.push(Map({ text }));
})
}
示例2: checkPanel
function checkPanel(): any {
const panels = atom.workspace.getModalPanels();
if (panels.length) {
const panelItem: GenericSelectListView = panels[0].item;
expect(panelItem._items.length).to.be.eql(2);
panelItem.onConfirm(panelItem._items[0].name);
return p;
} else {
return Observable.timer(100).toPromise()
.then(() => checkPanel());
}
}
示例3:
.buffer(newModel.observe.updates.throttle(100), () => Observable.timer(100)) // Group the changes so that we capture all the differences at once.