PillowPillow / ng2-webstorage

Localstorage and sessionstorage manager - Angular service
MIT License
428 stars 91 forks source link

Handle StorageEvent "clear" events properly #58

Closed mikejhill closed 6 years ago

mikejhill commented 7 years ago

I'm running into an issue where the library doesn't seem to handle storage "clear" events (e.g., sessionStorage.clear()). It runs into in exception in KeyStorageHelper.isManagedKey since the key for clear events is always null, as described by MDN (I'm crossing my fingers that MDN matches the spec here).

Additionally, the clear event doesn't seem to be clearing the module cache or emitting events for the cleared values.

image