Comments (5)
Great. Thank you for your Issue.
Don't hesitate to let me know if there's anything else I can do for you.
from immortaldb.
Before any implementation, to make sure we're on the same page: why would you
like to clear all cookies set by ImmortalDB?
Clearing all cookies will, of course, reduce ImmortalDB's redundancy. And the
next time a key with a removed cookie is read with get()
, that cookie will be
rewritten anyhow.
from immortaldb.
Hi, thanks for your reply. Yeah, my case might be an edge case, idk, you'll be judge of that:
I'm using ImmortalDB to create a rather elaborate autosaving feature for a game (played in the browser). Rather then periodically saving the whole game (which can be a lot of information), I only save the state of individual game objects (think: buildings, characters) when a meaningful change has occured. The removeAll()
would be to reset game.
So to abstract the problem: Whenever cookies are set programmatically, where you might not have full control over the amount and (exact) key? I don't know if that ever happens, I thought it would be handy, but I have since solved the problem in another way.
from immortaldb.
Gotcha. Thank you for the explanation. That's helpful.
So to abstract the problem: Whenever cookies are set programmatically, where
you might not have full control over the amount and (exact) key? I don't know
if that ever happens, I thought it would be handy, but I have since solved the
problem in another way.
Deleting all keys, like keys generated dynamically, is tricky. The underlying
storage APIs -- cookies, LocalStorage, SessionStorage, etc -- don't have an easy
way to query for all keys that match a pattern.
I considered ImmortalDB keeping track of all keys that ImmortalDB has written,
but that remains out of band for now.
Did you resolve this issue independently? If so, I'll close this Issue.
from immortaldb.
I considered ImmortalDB keeping track of all keys that ImmortalDB has written,
but that remains out of band for now.
I see, well, it isn't a pressing issue I suppose and yes, I have since solved the problem by tracking the setting of the cookies in the application itself (which is arguably a more sensible way to go anyway). Thanks for your insights, appreciate it (and the project as a whole). Have a splendid day. Cheers!
from immortaldb.
Related Issues (20)
- 😮 WOW! HOT 1
- Add eslint and prettier HOT 4
- how to handle expired mechanism HOT 7
- SSR compatible HOT 6
- I wouldn't recommend using SessionStorage HOT 3
- Ideas for additional persistent storage HOT 3
- Support for KV Storage HOT 2
- Reset database HOT 4
- Undefined should not be counted as value? HOT 2
- We don't use NPM or any module manager, so am getting "Cannot use import statement outside a module".... HOT 3
- Events HOT 6
- Add testing how-to snippet to the readme
- Set the SameSite attribute of saved cookies HOT 1
- Indexed DB HOT 1
- Differentiate a user-stored `'undefined'` from a deleted key with a sentinel value
- Use JSDoc HOT 3
- Synchronous get / set? HOT 1
- Size limit HOT 1
- Nextjs window is not defined error HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immortaldb.