Skip to content

Save state continuously; don't wait for unload #73

@dfabulich

Description

@dfabulich

Apropos this comment:

I've removed the beforeunload event. Instead, on unload, the current map gets saved to localStorage.

I think it would be better to save state as the user creates it (every time something is pushed onto the "undo" stack). That way, state will survive even if the browser tab crashes.

(If we do this, I think it would make sense to switch to IndexedDB, which has an async API, to ensure that saving the map doesn't lock the main thread. I recommend idb-keyval.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions