Skip to content

Commit e8d2495

Browse files
committed
ISSUE-90: Better handling of synchronous (sequential) requests
* fix failing test case
1 parent 9a0fe27 commit e8d2495

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/components/ng-http-loader.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ export class NgHttpLoaderComponent implements OnDestroy, OnInit {
4848
const [showSpinner, hideSpinner] = partition((h: boolean) => h)(this.pendingInterceptorService.pendingRequestsStatus$);
4949

5050
this.subscriptions = merge(
51-
showSpinner.pipe(debounce(() => timer(this.debounceDelay))),
51+
merge(showSpinner, hideSpinner).pipe(
52+
switchMap(() => showSpinner.pipe(debounce(() => timer(this.debounceDelay))))
53+
),
5254
showSpinner.pipe(
5355
switchMap(() => hideSpinner.pipe(debounce(() => this.getHiddingTimer())))
5456
),

0 commit comments

Comments
 (0)