Constant refresh caused by setTimeout() and addEventListener() #440
Labels
future-version
Will be considered, but for a future version.
pr-welcome
We'd welcome a PR to solve the issue.
First of all thank you @manfredsteyer for the great library which makes my life a lot easier!
I work on an Angular application and I recently came across the use of
zone.js
in Angular which is used to trigger view refresh on every event which could cause the UI to change. So, I started to investigate when our views are actually getting refreshed and I realised thatangular-oauth2-oidc
is causing it to refresh every 3000ms when it asks for the state of the session and than when it receives the response.I tried to run the initialization code out of Angular like this:
But setting silent refresh and session check happens in a different scope in asynchronous callbacks where
zone.runOutsideAngular()
doesn't seem to take effect.I realised there are already parts of the code which run outside of Angular and I believe that as a library it should only cause a refresh when it emits new event (like session timeout, expired tokens etc.) but not when working internally. Am I right? Or is there a way to run it out of Angular completely?
The text was updated successfully, but these errors were encountered: