本文整理汇总了TypeScript中core/signaling.Signal.emit方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Signal.emit方法的具体用法?TypeScript Signal.emit怎么用?TypeScript Signal.emit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core/signaling.Signal
的用法示例。
在下文中一共展示了Signal.emit方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: redo
redo() {
if (this.can_redo()) {
this.state.index += 1;
this._do_state_change(this.state.index);
return this.state_changed.emit(undefined);
}
}
示例2: push_state
push_state(type, info) {
const prev_info = (this.state.history[this.state.index] != null ? this.state.history[this.state.index].info : undefined) || {};
info = extend({}, this._initial_state_info, prev_info, info);
this.state.history.slice(0, this.state.index + 1);
this.state.history.push({type, info});
this.state.index = this.state.history.length - 1;
return this.state_changed.emit(undefined);
}
示例3: it
it("should support `{dis}connect()` method", () => {
const signal = new Signal(Object.create(null), "some")
let signaled: number = 0
const fn = (val: number) => signaled = val
expect(signal.connect(fn)).to.be.equal(true)
expect(signal.connect(fn)).to.be.equal(false)
expect(signaled).to.be.equal(0)
signal.emit(1)
expect(signaled).to.be.equal(1)
signal.emit(2)
expect(signaled).to.be.equal(2)
expect(signal.disconnect(fn)).to.be.equal(true)
expect(signal.disconnect(fn)).to.be.equal(false)
signal.emit(3)
expect(signaled).to.be.equal(2)
})
示例4:
document.addEventListener("click", () => clear_menus.emit(undefined))
示例5: clear_state
clear_state() {
this.state = {history: [], index: -1};
return this.state_changed.emit(undefined);
}
示例6: throttle
this.throttled_paint = throttle((() => this.force_paint.emit(undefined)), 15); // TODO (bev) configurable
示例7: update
update({xs, ys}) {
this.setv({xs, ys, screen: true}, {silent: true});
return this.data_update.emit();
}
示例8:
window._bokeh_gmaps_callback = () => gmaps_ready.emit(undefined);
示例9: update
update({left, right, top, bottom}) {
this.setv({left, right, top, bottom, screen: true}, {silent: true});
this.data_update.emit();
}