I am trying to use Ben Alman's debounce
code. I have the following code but I don't see anything executing at all.
onChange() {
var this_ = this
if (this.autoRefreshOn) {
Cowboy.debounce(function(e) {
console.log("debounce worked");
this_.doSomethingFunction();
}, 250);
}
}
This onChange()
function is fired from multiselect
boxes like this:
<ss-multiselect-dropdown (ngModelChange)="onChange($event)"></ss-multiselect-dropdown>
<ss-multiselect-dropdown (ngModelChange)="onChange($event)"></ss-multiselect-dropdown>
<ss-multiselect-dropdown (ngModelChange)="onChange($event)"></ss-multiselect-dropdown>
<ss-multiselect-dropdown (ngModelChange)="onChange($event)"></ss-multiselect-dropdown>
When these select boxes are checked they continuously fire onChange()
but I do not see any executions from the debounce
function.
All of the examples I found on the web implement a debounce function that is bind to a button press or something like that.