jmdobry / angular-cache

angular-cache is a very useful replacement for the Angular 1 $cacheFactory.
http://jmdobry.github.io/angular-cache
MIT License
1.39k stars 156 forks source link

Clearing localStorage causes angular-cache to become out of sync #39

Closed jmdobry closed 11 years ago

jmdobry commented 11 years ago

See #36

Angular-cache needs to somehow be able to detect when another party has modified angular-cache's items that are saved in localStorage and either fix the problem or modify its own internal state to reflect the changes.

jmdobry commented 11 years ago

The most angular-cache can do is continually sync its own internal state to localStorage, including during reads. That way, even if localStorage somehow gets wiped out with angular-cache is still running in the browser, angular-cache will eventually become consistent with localStorage.