In my angular application, I have implemented http calls on each modelChange
event with the help of lodash's _.debounce()
. However, I'm facing an issue where I am unable to cancel these calls after the initial successful execution of debounce.
modelChangeEvent(item):void {
const _this = this;
let debounceObj = _.debounce(function(){
_this.makeHttpCall(item);
debounceObj.cancel();
},600);
debounceObj();
}