Legacy Debugger 1.x
You can use the 1.x this.debounce() method with Polymer.LegacyElementMixin :
class XFoo extends Polymer.LegacyElementMixin(Polymer.Element) { ... _onClick() { this.debounce('myDebouncer', callback, 2000); } }
codepen
New 2.x debouncer 2.x
equivalent to 2.0 Polymer.Debouncer.debounce(debouncer, asyncModule, cb) , where:
debouncer
The Polymer.Debouncer instance returned from Polymer.Debouncer.debounce() , used to uniquely identify the debouncer job. This is equivalent to the debuger 1.x job name string. It can be initially undefined / null to create a new instance.
asyncModule
One of the following:
cb
Callback to call when asyncModule completes
This function returns an instance of Polymer.Debouncer that has a cancel() method equivalent to 1.x this.cancelDebouncer(JOB_NAME) . This instance must be passed to the debounce() method the next time it is called for debouncing to work properly.
Usage example:
class XFoo extends Polymer.Element { ... _onClick() { this._debouncer = Polymer.Debouncer.debounce( this._debouncer,
codepen
tony19
source share