Reputation: 9232
The Angular application I'm working on never gets into stable state, basing on ApplicationRef.isStable
, which only emits false
once. According to Angular docs:
the application will never be stable if you start any kind of recurrent asynchronous task when the application starts (for example for a polling process, started with a setInterval, a setTimeout or using RxJS operators like interval);
So I've reviewed all usages of setTimeout()
, setInterval()
(none) and RxJS' interval()
, which I delayed until appRef.isStable
gives true and the same with SignalR (kind of websocket) connection, but it all didn't help. I was trying to use DevTools' Performance, Memory and LightHouse tools to find the source of this unwanted behavior, but the only running task I've seen (for the first half of second in Performance tab) was from zone.js and slightly growing JS Heap:
In the Network tab nothing happens except pending connection with Angular's 127.0.0.1:4200/sockjs-node/*/websocket
on dev server, which I guess is fine. The same behavior (except Angular's websocket) can be seen consistently on all production environments.
Is there any way to debug it in order to find a reason for that? Any other advise?
Upvotes: 3
Views: 1185
Reputation: 54998
Just to complete Daniel's anwser;
This behavior will happen every time a macrotask (setInterval
, setTimeout
etc.) is called in the bootstraping phase of your app and it looks like windowTime
(like every other RxJS timed operators) uses one of them.
Upvotes: 0