I am currently utilizing the Google JS closure library which can be found at https://developers.google.com/closure/library/
Below is the code snippet that I have:
if (endDate >= wap.com.ifx.util.IfxComponentUtil.yyyymmdd(currentDate) && goog.object.isEmpty(token)) {
if (goog.isDefAndNotNull(this.reloadGridPromise_)) {
this.reloadGridPromise_.cancel('[INFO]Canceling');
}
this.reloadGridPromise_ = new wap.core.net.partialupdate.partialUpdate('getFilteredHistoryList?' + get_params(
vars), this.updateGridFlag);
var self = this;
this.reloadGridPromise_.then(function(response) {
//something
}
This particular block of code repeats every 5 seconds and the corresponding requests are visible in the Chrome developer tools.
https://i.stack.imgur.com/6W16a.png
Upon debugging the JavaScript code, it has been observed that the statement
this.reloadGridPromise_.cancel('[INFO]Canceling');
is being executed. However, there are no noticeable changes in the requests shown in Chrome developer tools.
More information on Google Closure promise can be found here:
Is this behavior expected as per the documentation?