Giter VIP home page Giter VIP logo

Comments (5)

gruns avatar gruns commented on May 22, 2024 1

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.

gruns avatar gruns commented on May 22, 2024

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.

Neugierdsnase avatar Neugierdsnase commented on May 22, 2024

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.

gruns avatar gruns commented on May 22, 2024

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.

Neugierdsnase avatar Neugierdsnase commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.