a2-in-memory-web-api
a2-in-memory-web-api copied to clipboard
Save/restore in-mem store to browser local storage (optional)
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.