Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted Change Detection Cycles #81

Open
denny99 opened this issue May 19, 2020 · 2 comments
Open

Unwanted Change Detection Cycles #81

denny99 opened this issue May 19, 2020 · 2 comments

Comments

@denny99
Copy link

denny99 commented May 19, 2020

Describe the bug
Right now the idleSubscription Observable triggers the change detection cycle and with small idleSensitivityMillisec the whole component tree gets checked all the time

To Reproduce
Steps to reproduce the behavior:

  1. Set a breakpoint in the change detection functions
  2. Just move the mouse around
  3. Change Cycle starts when buffer runs out
  4. Increase the idleSensitivityMillisec and you will see, that cycle calls will be less frequent

Expected behavior
No Change Detections. The service just tracks user status and does not change any components, so detection is not required

How I "fixed" it

this.zone.runOutsideAngular(() => {
  this.userIdle.startWatching();
});
@janvandenberg
Copy link

+1 we need this too

@Valdenirmezadri
Copy link

I had the same problem, it took me a while to find out that it was this lib, I solved it exactly the same way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants