forked from peerigon/template-public-package
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The web offers some simple key-value storage interfaces, such as localStorage, sessionStorage, or adapters for indexedDB.
However, using these storage options can cause a few problems in large applications or over a longer period of time:
- Keys can overlap (no warning if two code locations use the same key)
- Migration is not taken into account: how to deal with it if a different/new data format is needed
- If the logout process takes a little longer, it can happen that data is still written even after logging out and thus continues to exist after logging out
- Serializing and deserializing might not be loss-less, e.g.
undefinedwithJSON.stringify
The implementation should:
- Provide some kind of registry that prevents multiple code locations using the same key
- Work with version numbers immediately so that simple migrations can be written
- Offer a kind of kill switch (e.g., a
drop()method) after which it is no longer possible to write to storage - Offer a custom strategy for JSON.parse
Metadata
Metadata
Assignees
Labels
No labels