Skip to content

Instantly share code, notes, and snippets.

@Scarygami
Last active December 8, 2017 20:03
Show Gist options
  • Save Scarygami/a5def45785ceeeadbe10 to your computer and use it in GitHub Desktop.
Save Scarygami/a5def45785ceeeadbe10 to your computer and use it in GitHub Desktop.
Polymer debounce sample
Polymer({
is: 'with-debounce',
properties: {
property1: {
type: String,
observer: '_doSomething'
},
property2: {
type: String,
observer: '_doSomething'
},
},
_doSomething: function () {
this.debounce('doSomething', function () {
console.log('with-debounce needs to do something...');
}, 300);
}
});
Polymer({
is: 'without-debounce',
properties: {
property1: {
type: String,
observer: '_doSomething'
},
property2: {
type: String,
observer: '_doSomething'
},
},
_doSomething: function () {
console.log('without-debounce needs to do something...');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment