Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save and load from local storage #94

Merged
merged 14 commits into from
Aug 9, 2021
Merged

Save and load from local storage #94

merged 14 commits into from
Aug 9, 2021

Conversation

MikkelPaulson
Copy link
Collaborator

Implements saving and loading data via IndexedDB local storage.

Resolves #93.

Keeping ownership of everyThing within AppMeta, DataStore::save() now
only takes a reference to Thing. The calling code is expected to remain
the source of truth while the app is running.
Really, all we need is the ability to load all data from storage. We'll
do our searching against local data.
Rough in structure of web data store. Currently it just logs the data to
store to the console.
Update parameter to be clear about what we're searching for.
Command moves an entity from memory to local storage.
The name will never not be funny.

In the spirit of name(), added a method that reliably gets or sets the
inner UUID for a Thing, regardless of the inner type.
There was too much embedded logic in the command struct. Fortunately,
there's a name for that logic: the repository pattern!
In order to make the database queries asynchronous, we need run()
to be async, as well as the underling repository/data store save
methods.
Mash up web and www. Maybe a mistake? Maybe not? Anyway, it seems to
make the build process happier.
Module will be used to interface with IndexedDB.
This is it, folks. We can now dump data into the black hole that is the
data store. Currently no way to read it back, however.

Removing the WASM tests for now. They're not providing a whole lot of
value, and would probably be better handled with something
Selenium-based that can cover the JS side of things as well.
In addition to serializing Things and adding them to the IndexedDB, they
are now saved to cache.
Load entire local storage into cache when the page initializes. This
_should_ complete the save/load workflow.
@MikkelPaulson MikkelPaulson merged commit d3a8f54 into main Aug 9, 2021
@MikkelPaulson MikkelPaulson deleted the impl-local-storage branch August 9, 2021 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save and load from local storage
1 participant