Skip to content

Commit 9879bd7

Browse files
committed
feat(http): delay and timeout can be configured via forRoot method
1 parent 1a64f42 commit 9879bd7

File tree

6 files changed

+81
-65
lines changed

6 files changed

+81
-65
lines changed

projects/ngx-ui-loader/src/lib/core/ngx-ui-loader.component.spec.ts

+19-20
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { NgxUiLoaderComponent } from './ngx-ui-loader.component';
44
import { NgxUiLoaderService } from './ngx-ui-loader.service';
55
import { SimpleChange, ChangeDetectionStrategy } from '@angular/core';
66
import { SPINNER, POSITION, PB_DIRECTION } from '../utils/enums';
7-
import { SPINNER_CONFIG } from '../utils/constants';
7+
import { SPINNER_CONFIG, DEFAULT_CONFIG } from '../utils/constants';
88
import { PositionType } from '../utils/types';
99

1010
// DO NOT change the following constants {{{
@@ -21,7 +21,6 @@ const IS_MASTER = true;
2121
const LOADER_ID_01 = 'loader-id-01';
2222
const LOADING_BACKGROUND_CLASS = 'loading-background';
2323
const LOADING_FOREGROUND_CLASS = 'loading-foreground';
24-
const MIN_TIME = 500;
2524
const NGX_POSITION_ABSOLUTE_CLASS = 'ngx-position-absolute';
2625
const TASK_ID_01 = 'task-id-01';
2726
// }}}
@@ -362,8 +361,8 @@ describe('NgxUiLoaderComponent', () => {
362361
expect(fgContainerEl.className).toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
363362
setTimeout(() => {
364363
loaderService.stop();
365-
}, MIN_TIME);
366-
tick(MIN_TIME);
364+
}, DEFAULT_CONFIG.minTime);
365+
tick(DEFAULT_CONFIG.minTime);
367366
fixture.detectChanges();
368367
expect(progressBarEl.className).not.toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
369368
expect(fgContainerEl.className).not.toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
@@ -383,8 +382,8 @@ describe('NgxUiLoaderComponent', () => {
383382
expect(fgContainerEl.className).toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
384383
setTimeout(() => {
385384
loaderService.stop(TASK_ID_01);
386-
}, MIN_TIME);
387-
tick(MIN_TIME);
385+
}, DEFAULT_CONFIG.minTime);
386+
tick(DEFAULT_CONFIG.minTime);
388387
fixture.detectChanges();
389388
expect(progressBarEl.className).not.toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
390389
expect(fgContainerEl.className).not.toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
@@ -405,8 +404,8 @@ describe('NgxUiLoaderComponent', () => {
405404
expect(fgContainerEl.className).toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
406405
setTimeout(() => {
407406
loaderService.stop();
408-
}, MIN_TIME);
409-
tick(MIN_TIME);
407+
}, DEFAULT_CONFIG.minTime);
408+
tick(DEFAULT_CONFIG.minTime);
410409
fixture.detectChanges();
411410
expect(progressBarEl.className).toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
412411
expect(fgContainerEl.className).toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
@@ -424,8 +423,8 @@ describe('NgxUiLoaderComponent', () => {
424423
expect(fgContainerEl.className).toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
425424
setTimeout(() => {
426425
loaderService.stop();
427-
}, MIN_TIME);
428-
tick(MIN_TIME);
426+
}, DEFAULT_CONFIG.minTime);
427+
tick(DEFAULT_CONFIG.minTime);
429428
fixture.detectChanges();
430429
expect(progressBarEl.className).not.toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
431430
expect(fgContainerEl.className).not.toEqual(jasmine.stringMatching(LOADING_FOREGROUND_CLASS));
@@ -460,8 +459,8 @@ describe('NgxUiLoaderComponent', () => {
460459
expect(bgSpinnerEl.className).toEqual(jasmine.stringMatching(LOADING_BACKGROUND_CLASS));
461460
setTimeout(() => {
462461
loaderService.stopBackground();
463-
}, MIN_TIME);
464-
tick(MIN_TIME);
462+
}, DEFAULT_CONFIG.minTime);
463+
tick(DEFAULT_CONFIG.minTime);
465464
fixture.detectChanges();
466465
expect(bgSpinnerEl.className).not.toEqual(jasmine.stringMatching(LOADING_BACKGROUND_CLASS));
467466
expect(bgSpinnerEl.className).toEqual(jasmine.stringMatching(BACKGROUND_CLOSING_CLASS));
@@ -477,8 +476,8 @@ describe('NgxUiLoaderComponent', () => {
477476
expect(bgSpinnerEl.className).toEqual(jasmine.stringMatching(LOADING_BACKGROUND_CLASS));
478477
setTimeout(() => {
479478
loaderService.stopBackground('test');
480-
}, MIN_TIME);
481-
tick(MIN_TIME);
479+
}, DEFAULT_CONFIG.minTime);
480+
tick(DEFAULT_CONFIG.minTime);
482481
fixture.detectChanges();
483482
expect(bgSpinnerEl.className).not.toEqual(jasmine.stringMatching(LOADING_BACKGROUND_CLASS));
484483
expect(bgSpinnerEl.className).toEqual(jasmine.stringMatching(BACKGROUND_CLOSING_CLASS));
@@ -495,8 +494,8 @@ describe('NgxUiLoaderComponent', () => {
495494
expect(bgSpinnerEl.className).toEqual(jasmine.stringMatching(LOADING_BACKGROUND_CLASS));
496495
setTimeout(() => {
497496
loaderService.stopBackground();
498-
}, MIN_TIME);
499-
tick(MIN_TIME);
497+
}, DEFAULT_CONFIG.minTime);
498+
tick(DEFAULT_CONFIG.minTime);
500499
fixture.detectChanges();
501500
expect(bgSpinnerEl.className).toEqual(jasmine.stringMatching(LOADING_BACKGROUND_CLASS));
502501
expect(bgSpinnerEl.className).not.toEqual(jasmine.stringMatching(BACKGROUND_CLOSING_CLASS));
@@ -518,8 +517,8 @@ describe('NgxUiLoaderComponent', () => {
518517
fixture.detectChanges();
519518
setTimeout(() => {
520519
loaderService.stopLoader(LOADER_ID_01);
521-
}, MIN_TIME);
522-
tick(MIN_TIME);
520+
}, DEFAULT_CONFIG.minTime);
521+
tick(DEFAULT_CONFIG.minTime);
523522
fixture.detectChanges();
524523
expect(progressBarEl.className).not.toMatch(FOREGROUND_CLOSING_CLASS);
525524
expect(progressBarEl.className).toMatch(LOADING_FOREGROUND_CLASS);
@@ -546,8 +545,8 @@ describe('NgxUiLoaderComponent', () => {
546545
fixture.detectChanges();
547546
setTimeout(() => {
548547
loaderService.stopBackgroundLoader(LOADER_ID_01);
549-
}, MIN_TIME);
550-
tick(MIN_TIME);
548+
}, DEFAULT_CONFIG.minTime);
549+
tick(DEFAULT_CONFIG.minTime);
551550
fixture.detectChanges();
552551
expect(bgSpinnerEl.className).not.toMatch(BACKGROUND_CLOSING_CLASS);
553552
expect(bgSpinnerEl.className).toMatch(LOADING_BACKGROUND_CLASS);

projects/ngx-ui-loader/src/lib/core/ngx-ui-loader.service.spec.ts

+36-25
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { TestBed, inject, fakeAsync, tick } from '@angular/core/testing';
22

33
import { NgxUiLoaderService } from './ngx-ui-loader.service';
44
import { DEFAULT_CONFIG } from '../utils/constants';
5-
import { NgxUiLoaderModule } from './ngx-ui-loader.module';
65

76
// DO NOT change the following constants {{{
87
const BACKGROUND = false;
@@ -18,7 +17,7 @@ const FOREGROUND = true;
1817
const IS_BOUND = true;
1918
const IS_MASTER = true;
2019
const LOADER_ID_01 = 'loader-id-01';
21-
const MIN_TIME = 500;
20+
const MIN_TIME = 300;
2221
const MAX_TIME = 8000;
2322
const NOT_EXISTING_LOADER_ID = 'not-existing-loader-id';
2423
const NOT_EXISTING_TASK_ID = 'not-existing-task-id';
@@ -33,14 +32,24 @@ describe('NgxUiLoaderService with custom config', () => {
3332
expect(loaderService.getDefaultConfig()).toEqual(DEFAULT_CONFIG);
3433
});
3534

36-
it('NgxUiLoaderService({ minTime: 20 }) should return DEFAUL_CONFIG', () => {
37-
const loaderService = new NgxUiLoaderService({ minTime: 20 });
38-
expect(loaderService.getDefaultConfig()).toEqual({ ...DEFAULT_CONFIG, minTime: 20 });
35+
it(`NgxUiLoaderService({ minTime: -20 }) should return minTime: ${MIN_TIME}`, () => {
36+
const loaderService = new NgxUiLoaderService({ minTime: -20 });
37+
expect(loaderService.getDefaultConfig()).toEqual({ ...DEFAULT_CONFIG, minTime: MIN_TIME });
3938
});
4039

41-
it('NgxUiLoaderService({ minTime: -20 }) should return DEFAUL_CONFIG', () => {
42-
const loaderService = new NgxUiLoaderService({ minTime: -20 });
43-
expect(loaderService.getDefaultConfig()).toEqual(DEFAULT_CONFIG);
40+
it(`NgxUiLoaderService({ minTime: ${MIN_TIME - 1} }) should return DEFAUL_CONFIG`, () => {
41+
const loaderService = new NgxUiLoaderService({ minTime: MIN_TIME - 1 });
42+
expect(loaderService.getDefaultConfig()).toEqual({ ...DEFAULT_CONFIG, minTime: MIN_TIME });
43+
});
44+
45+
it(`NgxUiLoaderService({ minTime: ${MIN_TIME} }) should return minTime: ${MIN_TIME}`, () => {
46+
const loaderService = new NgxUiLoaderService({ minTime: MIN_TIME });
47+
expect(loaderService.getDefaultConfig()).toEqual({ ...DEFAULT_CONFIG, minTime: MIN_TIME });
48+
});
49+
50+
it(`NgxUiLoaderService({ minTime: ${MIN_TIME + 1} }) should return minTime: ${MIN_TIME + 1}`, () => {
51+
const loaderService = new NgxUiLoaderService({ minTime: MIN_TIME + 1 });
52+
expect(loaderService.getDefaultConfig()).toEqual({ ...DEFAULT_CONFIG, minTime: MIN_TIME + 1 });
4453
});
4554
});
4655

@@ -643,8 +652,8 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
643652
loaderService.startLoader(DEFAULT_MASTER_LOADER_ID);
644653
setTimeout(() => {
645654
loaderService.stopLoader(DEFAULT_MASTER_LOADER_ID);
646-
}, MIN_TIME - 1);
647-
tick(MIN_TIME - 1);
655+
}, DEFAULT_CONFIG.minTime - 1);
656+
tick(DEFAULT_CONFIG.minTime - 1);
648657
expect(loaderService.hasRunningTask(FOREGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_FG_TASK_ID)).toEqual(true);
649658
tick(1);
650659
expect(loaderService.hasRunningTask(FOREGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_FG_TASK_ID)).toEqual(false);
@@ -660,8 +669,8 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
660669
loaderService.startLoader(DEFAULT_MASTER_LOADER_ID);
661670
setTimeout(() => {
662671
loaderService.stopLoader(DEFAULT_MASTER_LOADER_ID);
663-
}, MIN_TIME - 1);
664-
tick(MIN_TIME - 1);
672+
}, DEFAULT_CONFIG.minTime - 1);
673+
tick(DEFAULT_CONFIG.minTime - 1);
665674
expect(loaderService.hasRunningTask(FOREGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_FG_TASK_ID)).toEqual(true);
666675
tick(1);
667676
expect(loaderService.hasRunningTask(FOREGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_FG_TASK_ID)).toEqual(false);
@@ -681,8 +690,8 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
681690
loaderService.startLoader(DEFAULT_MASTER_LOADER_ID);
682691
setTimeout(() => {
683692
loaderService.stopLoader(DEFAULT_MASTER_LOADER_ID);
684-
}, MIN_TIME - 1);
685-
tick(MIN_TIME - 1);
693+
}, DEFAULT_CONFIG.minTime - 1);
694+
tick(DEFAULT_CONFIG.minTime - 1);
686695
expect(loaderService.hasRunningTask(FOREGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_FG_TASK_ID)).toEqual(true);
687696
tick(1);
688697
expect(loaderService.hasRunningTask(FOREGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_FG_TASK_ID)).toEqual(false);
@@ -712,8 +721,8 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
712721
loaderService.start();
713722
setTimeout(() => {
714723
loaderService.stop();
715-
}, MIN_TIME - 1);
716-
tick(MIN_TIME - 1);
724+
}, DEFAULT_CONFIG.minTime - 1);
725+
tick(DEFAULT_CONFIG.minTime - 1);
717726
expect(loaderService.hasRunningTask(FOREGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_FG_TASK_ID)).toEqual(true);
718727
tick(1);
719728
expect(loaderService.hasRunningTask(FOREGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_FG_TASK_ID)).toEqual(false);
@@ -740,8 +749,8 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
740749
loaderService.startBackgroundLoader(DEFAULT_MASTER_LOADER_ID);
741750
setTimeout(() => {
742751
loaderService.stopBackgroundLoader(DEFAULT_MASTER_LOADER_ID);
743-
}, MIN_TIME - 1);
744-
tick(MIN_TIME - 1);
752+
}, DEFAULT_CONFIG.minTime - 1);
753+
tick(DEFAULT_CONFIG.minTime - 1);
745754
expect(loaderService.hasRunningTask(BACKGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_BG_TASK_ID)).toEqual(true);
746755
tick(1);
747756
expect(loaderService.hasRunningTask(BACKGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_BG_TASK_ID)).toEqual(false);
@@ -757,8 +766,8 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
757766
loaderService.startBackgroundLoader(DEFAULT_MASTER_LOADER_ID);
758767
setTimeout(() => {
759768
loaderService.stopBackgroundLoader(DEFAULT_MASTER_LOADER_ID);
760-
}, MIN_TIME - 1);
761-
tick(MIN_TIME - 1);
769+
}, DEFAULT_CONFIG.minTime - 1);
770+
tick(DEFAULT_CONFIG.minTime - 1);
762771
expect(loaderService.hasRunningTask(BACKGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_BG_TASK_ID)).toEqual(true);
763772
tick(1);
764773
expect(loaderService.hasRunningTask(BACKGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_BG_TASK_ID)).toEqual(false);
@@ -777,8 +786,8 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
777786
loaderService.startBackground();
778787
setTimeout(() => {
779788
loaderService.stopBackground();
780-
}, MIN_TIME - 1);
781-
tick(MIN_TIME - 1);
789+
}, DEFAULT_CONFIG.minTime - 1);
790+
tick(DEFAULT_CONFIG.minTime - 1);
782791
expect(loaderService.hasRunningTask(BACKGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_BG_TASK_ID)).toEqual(true);
783792
tick(1);
784793
expect(loaderService.hasRunningTask(BACKGROUND, DEFAULT_MASTER_LOADER_ID, DEFAULT_BG_TASK_ID)).toEqual(false);
@@ -892,7 +901,9 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
892901
loaderService = new NgxUiLoaderService({ maxTime: MAX_TIME, delay: DELAY });
893902
loaderService.bindLoaderData(DEFAULT_MASTER_LOADER_ID);
894903
loaderService.start();
895-
tick(DELAY + MAX_TIME);
904+
tick(DELAY + 10);
905+
loaderService.start();
906+
tick(MAX_TIME);
896907
loaderService.showForeground$.subscribe(data => {
897908
expect(data).toEqual({ loaderId: DEFAULT_MASTER_LOADER_ID, isShow: false });
898909
});
@@ -910,15 +921,15 @@ describe(`NgxUiLoaderService (loaderId == ${DEFAULT_MASTER_LOADER_ID})`, () => {
910921
it(`#Stop automatically due to timeout('${DEFAULT_MASTER_LOADER_ID}') - 2 - should work correctly`, fakeAsync(() => {
911922
loaderService = new NgxUiLoaderService({ maxTime: MAX_TIME, delay: DELAY });
912923
loaderService.bindLoaderData(DEFAULT_MASTER_LOADER_ID);
913-
loaderService.start(DEFAULT_FG_TASK_ID, { maxTime: MAX_TIME - 20, delay: DELAY - 20, minTime: MIN_TIME - 20 });
924+
loaderService.start(DEFAULT_FG_TASK_ID, { maxTime: MAX_TIME - 20, delay: DELAY - 20, minTime: DEFAULT_CONFIG.minTime - 20 });
914925
tick(DELAY + MAX_TIME - 20);
915926
loaderService.showForeground$.subscribe(data => {
916927
expect(data).toEqual({ loaderId: DEFAULT_MASTER_LOADER_ID, isShow: false });
917928
});
918929
loaderService.startBackground(DEFAULT_FG_TASK_ID, {
919930
maxTime: MAX_TIME - 30,
920931
delay: DELAY - 30,
921-
minTime: MIN_TIME - 30
932+
minTime: DEFAULT_CONFIG.minTime - 30
922933
});
923934
tick(DELAY + MAX_TIME - 30);
924935
expect(loaderService.getLoaders()[DEFAULT_MASTER_LOADER_ID]).toEqual({

projects/ngx-ui-loader/src/lib/core/ngx-ui-loader.service.ts

+17-13
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
DEFAULT_FG_TASK_ID,
1010
DEFAULT_TIME,
1111
FOREGROUND,
12+
MIN_DELAY,
13+
MIN_TIME,
1214
WAITING_FOR_OVERLAY_DISAPPEAR
1315
} from '../utils/constants';
1416
import { NGX_UI_LOADER_CONFIG_TOKEN } from './ngx-ui-loader-config.token';
@@ -56,8 +58,8 @@ export class NgxUiLoaderService {
5658
constructor(@Optional() @Inject(NGX_UI_LOADER_CONFIG_TOKEN) private config: NgxUiLoaderConfig) {
5759
this.defaultConfig = { ...DEFAULT_CONFIG };
5860
if (this.config) {
59-
if (this.config.minTime && this.config.minTime <= 0) {
60-
this.config.minTime = DEFAULT_CONFIG.minTime;
61+
if (this.config.minTime && this.config.minTime < MIN_TIME) {
62+
this.config.minTime = MIN_TIME;
6163
}
6264
this.defaultConfig = { ...this.defaultConfig, ...this.config };
6365
}
@@ -440,9 +442,9 @@ export class NgxUiLoaderService {
440442
this.loaders[loaderId].tasks[taskId] = {
441443
taskId,
442444
isForeground,
443-
minTime: time.minTime > 0 ? time.minTime : this.defaultConfig.minTime,
445+
minTime: time.minTime >= MIN_TIME ? time.minTime : this.defaultConfig.minTime,
444446
maxTime: time.maxTime ? time.maxTime : this.defaultConfig.maxTime,
445-
delay: time.delay ? time.delay : this.defaultConfig.delay
447+
delay: time.delay >= MIN_DELAY ? time.delay : this.defaultConfig.delay
446448
};
447449
} else {
448450
if (this.loaders[loaderId].tasks[taskId].isForeground !== isForeground) {
@@ -492,7 +494,7 @@ export class NgxUiLoaderService {
492494
* @returns boolean
493495
*/
494496
private setDelayTimer(task: Task, loaderId: string): boolean {
495-
if (task.delay > 0) {
497+
if (task.delay > MIN_DELAY) {
496498
if (task.isDelayed) {
497499
return true;
498500
}
@@ -519,15 +521,17 @@ export class NgxUiLoaderService {
519521
*/
520522
private setMaxTimer(task: Task, loaderId: string): void {
521523
if (task.maxTime > task.minTime) {
522-
if (!task.maxTimer) {
523-
task.maxTimer = setTimeout(() => {
524-
if (task.isForeground) {
525-
this.stopLoader(loaderId, task.taskId);
526-
} else {
527-
this.stopBackgroundLoader(loaderId, task.taskId);
528-
}
529-
}, task.maxTime);
524+
// restart the task, reset maxTimer
525+
if (task.maxTimer) {
526+
clearTimeout(task.maxTimer);
530527
}
528+
task.maxTimer = setTimeout(() => {
529+
if (task.isForeground) {
530+
this.stopLoader(loaderId, task.taskId);
531+
} else {
532+
this.stopBackgroundLoader(loaderId, task.taskId);
533+
}
534+
}, task.maxTime);
531535
}
532536
}
533537

projects/ngx-ui-loader/src/lib/http/ngx-ui-loader-http.interceptor.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ export class NgxUiLoaderHttpInterceptor implements HttpInterceptor {
4242
}
4343

4444
this.count++;
45-
if (!this.loader.hasRunningTask(this.config.showForeground, this.config.loaderId, HTTP_LOADER_TASK_ID)) {
46-
if (this.config.showForeground) {
47-
this.loader.startLoader(this.config.loaderId, HTTP_LOADER_TASK_ID);
48-
} else {
49-
this.loader.startBackgroundLoader(this.config.loaderId, HTTP_LOADER_TASK_ID);
50-
}
45+
if (this.config.showForeground) {
46+
this.loader.startLoader(this.config.loaderId, HTTP_LOADER_TASK_ID, this.config);
47+
} else {
48+
this.loader.startBackgroundLoader(this.config.loaderId, HTTP_LOADER_TASK_ID, this.config);
5149
}
5250

5351
return next.handle(req).pipe(

projects/ngx-ui-loader/src/lib/utils/constants.ts

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export const DEFAULT_MASTER_LOADER_ID = 'master';
1818

1919
export const DEFAULT_TIME: Time = {};
2020

21+
export const MIN_DELAY = 0;
22+
23+
export const MIN_TIME = 300;
24+
2125
export const CLOSING_TIME = 1001;
2226

2327
export const BACKGROUND = false;

projects/ngx-ui-loader/src/lib/utils/interfaces.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ export interface NgxUiLoaderConfig extends Time {
7676
textPosition?: PositionType;
7777
}
7878

79-
export interface NgxUiLoaderHttpConfig extends Config {}
79+
export interface NgxUiLoaderHttpConfig extends Config, Time {}
8080

8181
export interface NgxUiLoaderRouterConfig extends Config {}

0 commit comments

Comments
 (0)