PolymerElements / iron-input

An input with data binding
https://webcomponents.org/element/PolymerElements/iron-input
33 stars 45 forks source link

Provide an optional debounce value for input updates #105

Open iainjreid opened 7 years ago

iainjreid commented 7 years ago

I've drafted a PR (#106) for a debounce feature allowing the input value to only be updated after N milliseconds of inactivity. This would dramatically reduce the pain of calling this.debounce in all of my application logic where user input causes spammy requests in some cases.

Does this look and or sound like a reasonable addition to this element? Improvement suggestions welcome!

MeTaNoV commented 7 years ago

would be gr8 to have this as default for any kind of input!

iainjreid commented 7 years ago

Ideally, I think that this functionality would sit in a behaviour so it could be easily shared around, but the update logic in this component is currently tightly coupled with the component itself. Without some intervention or advice from the Polymer team, I'm not sure how easy that would be to orchestrate... As always, suggestions welcome though!