Answer the question
In order to leave comments, you need to log in
Rxjs thread start on completion?
There are several outgoing requests on the page, for example:
_a$ = of(1).pipe(delay(6000));
_b$ = of(2).pipe(delay(5000));
let preloaderState$ = new BehaviorSubject<boolean>(false);
preloaderState$
if after 2 seconds there is still no response from forkJoin?forkJoin$ = forkJoin(_a$, _b$);
forkJoin$.subscribe((data) =.> {});
forkJoin(obs)
.pipe(takeUntil(this.stop$))
.subscribe(
() => {
this.stop$.next();
this.stop$.complete();
},
(error) => console.log("ERROR: " + error)
);
of(true)
.pipe(
delay(2000),
takeUntil(this.stop$)
)
.subscribe(
() => {
this.preloaderState$.next(true);
});
Answer the question
In order to leave comments, you need to log in
request$;
preloaderState$ = concat(
of(false),
timer(2000).pipe(mapTo(true), takeUntil(request$)),
request$.pipe(mapTo(false)),
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question