question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Normalize storage event

See original GitHub issue

Love 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:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dfdeagle47commented, Dec 29, 2019

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.

0reactions
planttheideacommented, Jul 7, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found