kui-utils 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -2088,9 +2088,9 @@ var KUIUtilsSettings = /** @class */ (function () {
2088
2088
  }());
2089
2089
  var kuiUtilsSettings = new KUIUtilsSettings();
2090
2090
 
2091
- var delayTime = 600;
2091
+ var defaultDelayTime = 600;
2092
2092
  var Loader = /** @class */ (function () {
2093
- function Loader(isLoading) {
2093
+ function Loader(isLoading, delayTime) {
2094
2094
  var _this = this;
2095
2095
  this.startLoading = function (message, withoutCleanError) {
2096
2096
  _this.isLoading = true;
@@ -2105,13 +2105,13 @@ var Loader = /** @class */ (function () {
2105
2105
  return null;
2106
2106
  }
2107
2107
  _this.timeAfterLoading = new Date().getTime();
2108
- if (_this.timeAfterLoading - _this.timeBeforeLoading < delayTime) {
2108
+ if (_this.timeAfterLoading - _this.timeBeforeLoading < _this.delayTime) {
2109
2109
  return new Promise(function (resolve) {
2110
2110
  // eslint-disable-next-line no-promise-executor-return
2111
2111
  return setTimeout(function () {
2112
2112
  _this.isLoading = false;
2113
2113
  resolve(true);
2114
- }, delayTime - (_this.timeAfterLoading - _this.timeBeforeLoading));
2114
+ }, _this.delayTime - (_this.timeAfterLoading - _this.timeBeforeLoading));
2115
2115
  });
2116
2116
  }
2117
2117
  _this.isLoading = false;
@@ -2130,6 +2130,7 @@ var Loader = /** @class */ (function () {
2130
2130
  this.hasError = false;
2131
2131
  this.timeBeforeLoading = 0;
2132
2132
  this.timeAfterLoading = 0;
2133
+ this.delayTime = delayTime || defaultDelayTime;
2133
2134
  mobx.makeAutoObservable(this);
2134
2135
  }
2135
2136
  return Loader;