pamelafox / lscache

A localStorage-based memcache-inspired client-side caching library.
Other
1.46k stars 160 forks source link

Convert localStorage loop to for-in #94

Closed olaf-cloudgenix closed 4 years ago

olaf-cloudgenix commented 4 years ago

I noticed that on Chrome flush was missing some items, and traced it to the way eachKey loops through localStorage. I observed exactly the problem that reverse iteration is supposed to mitigate: some object keys got missed. Using for in fixed it.