Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/backoff_timer.min.js |
define ("core/backoff_timer",function(){var a=function(a,b){this.callback=a;this.backOffFunction=b};a.prototype.callback=null;a.prototype.backOffFunction=null;a.prototype.time=null;a.prototype.timeout=null;a.prototype.generateNextTime=function(){var a=this.backOffFunction(this.time);this.time=a;return a};a.prototype.reset=function(){this.time=null;this.stop();return this};a.prototype.stop=function(){if(this.timeout){window.clearTimeout(this.timeout);this.timeout=null}return this};a.prototype.start=function(){if(!this.timeout){var a=this.generateNextTime();this.timeout=window.setTimeout(function(){this.callback();this.stop();this.start()}.bind(this),a)}return this};a.prototype.restart=function(){return this.reset().start()};a.getIncrementalCallback=function(a,b,c,d){return function(e){if(!e){return a}if(e+b>c){return d}return e+b}};return a}); //# sourceMappingURL=backoff_timer.min.js.map