Normalize storage event
See original GitHub issueLove the package! The normalization it tries to do for browser storage is awesome, except I noticed that it does not provide the same normalization for the storage change events.
For localStorage
/ sessionStorage
, the spec includes a standard storage
event that notifies of the change (https://developer.mozilla.org/en-US/docs/Web/Events/storage), and there is a similar fallback for cookies (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/cookies/onChanged). It would be pretty sweet if we could normalize that to a standard event that you could listen to on the imported object, something like
import storage from 'local-storage-fallback';
storage.on('change', () => {...});
This would facilitate cross-tab communication more in line with the localStorage
spec, even if cookies are used. What do you think?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Event Data Normalization vs. Denormalization
Generally speaking, there are two main options for denormalizing data. First, data can be denormalized during event creation time, before it leaves the...
Read more >Event Processing – Normalization – Cyber Security
The process of taking raw input events and extracting individual fields is called normalization. Sometimes there are other processes which are ...
Read more >Normalization - Trellix Product Documentation
Combine similar events to reduce processing time and storage requirements. Events that result from fundamentally identical activities can be automatically ...
Read more >The Advanced Security Information Model (ASIM) File Event ...
The File Event normalization schema is used to describe file activity such as creating, modifying, or deleting files or documents.
Read more >Event Sourcing: Read Model Normalized or Denormalized
In event sourcing your events are a source of truth, and your read models are computed from these events. You can compute both...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A side note if anyone is looking to implement this: normally, the “storage” event is only fired in tabs that did not initiate the change.
However, on IE11, the “storage” event is fired on all tabs (even the one that triggered the change).
If the storage event is normalized, we’d have to decide whether we want to keep the IE11 behavior for all storage fallbacks, or fix this issue as well. Personally, I’d fix it to normalize the behavior across all browsers.
Yup, I think that would work. Logically if cookie storage was used the storage event would not exist, so you’re not trampling over native events.