I have written an angular application in which im making http calls on each modelChange
event. I have used lodash _.debounce()
. The issue is im not able to cancel these calls after the first successful execution of debounce.
modelChangeEvent(item):void {
const _this = this;
let debounceObj = _.debounce(function(){
_this.makeHttpCall(item);
debounceObj.cancel();
},600);
debounceObj();
}