Open KoenPasman opened 8 years ago
I'm not sure why the test is failing, it looks like the $apply
function is used in other usecases as well. Maybe someone can shed some light on that?
Allright! I managed to get the optimization working without breaking the tests. The problem was that the tempstorage reference always needs to be deleted, even if we don't persist the value into storage.
I integrated a custom serializer and deserializer (in order to put gzip the content using lz-string lib). However, changing a certain setting caused all the keys to get reset in localStorage. Besides the entry that needs changing, also other entries are refreshed where this is not needed. Combine that with a rather slow/expensive compress function, this leads to performance degradation.
The PR checks if the key is actually changed before resetting it in the storageProvider.