Handle namespace
See original GitHub issueHi,
It would be nice to be able to set a namespace when using store.js, because if you use store on your website and do a store.clear(), it clear all the localStorage and you can probably impact other websites that are using localStorage too.
It could be something like :
store.set('username', 'marcus') // 'username' => 'marcus'
store.get('username') // 'marcus'
store.clear() // clear ALL the localStorage
store.namespace('myNameSpace');
store.set('username', 'john') // 'myNameSpace.username' => 'john'
store.get('username') // 'john'
store.clear() // clear all myNameSpace keys in localStorage
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Namespaces - Kubernetes
In Kubernetes, namespaces provides a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique ...
Read more >How to handle namespaces in C++? - Stack Overflow
So in your case, you need to close the namespaces where the forward declaration is. namespace com { namespace example { namespace mydialogs ......
Read more >namespaces(7) - Linux manual page - man7.org
A namespace wraps a global system resource in an abstraction that makes it ... file handle for the corresponding namespace of the process...
Read more >RFC 3651: Handle System Namespace and Service Definition
The namespace definition specifies the handle syntax and its semantic ... RFC 3651 Handle System Service Definition November 2003 Table of Contents 1....
Read more >Configure namespaces and namespace-scoped objects
This page illustrates how to use Config Sync to manage namespaces and namespace-scoped objects. Configure a namespace. Configuring a namespace functions ...
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
Store.js v2.0 has been released with support for namespaces!
One of the plugins uses it to store expiration timestamps: https://github.com/marcuswestin/store.js/blob/master/plugins/expire.js
If you update to the latest version you will automatically get this functionality plus a bunch more 😃
Namespaces are now implemented in version 2. Stay tuned for a release in the new year, or get the release candidate at https://github.com/marcuswestin/store.js/tree/v2-dev?files=1