【发布时间】:2018-08-06 10:55:33
【问题描述】:
我正在尝试在 Web 组件完成加载时运行一次 getResponse。但是,当我尝试运行它时,debounce 函数只是充当异步延迟,并在 5000 毫秒后运行 4 次。
static get properties() {
return {
procedure: {
type: String,
observer: 'debounce'
}
}
}
debounce() {
this._debouncer = Polymer.Debouncer.debounce(this._debouncer, Polymer.Async.timeOut.after(5000), () => {
this.getResponse();
});
}
getResponse() {
console.log('get resp');
}
在加载元素时让getResponse 运行一次需要什么?
【问题讨论】:
标签: polymer polymer-2.x debouncing debounce