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

ngStorage causes digests through entire application #274

Open
gildebrand opened this issue Oct 23, 2017 · 2 comments
Open

ngStorage causes digests through entire application #274

gildebrand opened this issue Oct 23, 2017 · 2 comments

Comments

@gildebrand
Copy link

gildebrand commented Oct 23, 2017

I just discovered after some thorough searching in my application that this plugin causes ~10 digests per second. This makes our application feel slow in some parts, and we would really like to get rid of this. I tried commenting out the referenced line, and then our application got way faster.

Why is this line necessary, and what can we do about it? I guess that this is were data is actually persisted, since it's name infers that it's doing some kind of internal digest.

ngStorage/ngStorage.js

Lines 206 to 208 in b8054d4

$rootScope.$watch(function() {
_debounce || (_debounce = $timeout($storage.$apply, 100, false));
});

@johannesjo
Copy link

johannesjo commented Oct 30, 2017

I ran into the same issue. Maybe it's much more efficient to use object getters and setters or Proxy?

@igorc2
Copy link

igorc2 commented Dec 14, 2017

To solve this issue you can use $evalAsync instead of $apply .

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