@osovitny/anatoly 3.19.9 → 3.19.10

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.
@@ -2423,29 +2423,36 @@ class LoadingService extends BehaviorSubject {
2423
2423
  //Public
2424
2424
  this.isFreezed = false;
2425
2425
  }
2426
- show() {
2427
- this.counter++;
2426
+ setTimeout(fn, timeout = 500) {
2428
2427
  let that = this;
2429
2428
  setTimeout(() => {
2429
+ if (fn)
2430
+ fn(that);
2431
+ }, timeout);
2432
+ }
2433
+ show() {
2434
+ this.counter++;
2435
+ this.setTimeout((that) => {
2430
2436
  if (that.counter > 0) {
2431
2437
  that.next(true);
2432
2438
  }
2433
- }, 500);
2439
+ });
2434
2440
  }
2435
2441
  hide() {
2436
2442
  if (this.counter <= 0) {
2437
2443
  return;
2438
2444
  }
2439
2445
  this.counter--;
2440
- if (this.counter == 0) {
2441
- this.next(false);
2442
- }
2446
+ this.setTimeout((that) => {
2447
+ if (that.counter == 0) {
2448
+ that.next(false);
2449
+ }
2450
+ });
2443
2451
  }
2444
2452
  freeze(timeout = 1000) {
2445
2453
  this.isFreezed = true;
2446
- let that = this;
2447
- setTimeout(() => {
2448
- this.isFreezed = false;
2454
+ this.setTimeout((that) => {
2455
+ that.isFreezed = false;
2449
2456
  }, timeout);
2450
2457
  }
2451
2458
  reset() {