a2-in-memory-web-api icon indicating copy to clipboard operation
a2-in-memory-web-api copied to clipboard

Save/restore in-mem store to browser local storage (optional)

Open wardbell opened this issue 9 years ago • 0 comments

Ability to serialize/deserialize locally would facilitate browser refresh scenarios, simulating offline, etc.

On start the in-mem server could check browser storage for a well-known (configurable) named store. Server will load from there upon startup, falling back to resetDb() if not found.

During the life of the session, in-mem server updates that local store as side-effect of save (CUD) calls.

A call to commands/resetdb would reset the local store to the db initial state..

Probably should have a separate commands/clear-local-storage for that purpose alone.

wardbell avatar Jan 20 '16 20:01 wardbell