New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle namespace #133
Comments
Or you could just use store2. It already has namespace support. |
Nice, I wasn't aware of this one, it should be part of the marcuswestin/store.js readme. @nbubna : store2 works great, thanks 👍 |
They're unrelated projects, actually. Marcus and i wrote them separately and with diverging goals. Marcus beat me to the punch with the publication (at least to NPM), so i conceded the name and went with "store2", since mine is more aimed at forward features than backward polyfills. Do take note that you need the store.old.js extension for store2 to work in IE6, if you care. |
"They're unrelated projects, actually." => Ok so is it still an issue/feature enhancment for this project ? "you need the store.old.js extension for store2 to work in IE6, if you care" => I don't care about IE < 9 :) |
That's up to Marcus, of course. |
Hi @Shuunen, I'll be pushing a v2 iteration with lots of new features, including the stuff you've mentioned here. It's the result of observing exactly what people want and need on top of basic storage since initial release in 2010. @nbubna if you're up for a collaborative effort of any sort I'm all ears! |
@Shuunen @nbubna I'd like to point out two projects that might be of interest to you guys. First one is my own: memorystorage. It's a simple memory-backed shim for local/sessionStorage. The other is Rhaboo by Adrian May. I actually built MemoryStorage as a fix for Rhaboo not working when Safari is in Private Browsing mode. Rhaboo's got some pretty smart stuff in it to give you more or less linear performance when the size of objects or arrays you put into localStorage grows. It doesn't just Also, my current project leans very heavily on local storage so I'm invested in it. As such I'd be willing to contribute to any mutual effort we might make. Let me know your thoughts. |
store.js v2 is almost complete, and has namespace functionality (among a bunch of additional addon features - see https://github.com/marcuswestin/store.js/tree/v2-dev/storage & https://github.com/marcuswestin/store.js/tree/v2-dev/addon) |
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 |
Store.js v2.0 has been released with support for namespaces! var ns1 = store.namespace('ns1')
var ns2 = store.namespace('ns2')
ns1.set('foo', 'bar1')
ns2.set('foo', 'bar2')
ns1.get('foo') == 'bar1'
ns2.get('foo') == 'bar2' 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 :) |
Hi,
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 :
The text was updated successfully, but these errors were encountered: