ngStorage icon indicating copy to clipboard operation
ngStorage copied to clipboard

ngStorage causes digests through entire application

Open gildebrand opened this issue 6 years ago • 2 comments

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.

https://github.com/gsklee/ngStorage/blob/b8054d4d9b6691b261c004d06871347e6218d825/ngStorage.js#L206-L208

gildebrand avatar Oct 23 '17 14:10 gildebrand

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

johannesjo avatar Oct 30 '17 00:10 johannesjo

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

igorc2 avatar Dec 14 '17 13:12 igorc2