[base] Make settings store observable + integrate with DocumentsListPane #977
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This includes a small refactor of the settings store so that changes in keys can be subscribed to. It fixes a regression from the structure feature that broke persisting of sort order/layout for document lists.
I also refactored out the localStorage/noop storage parts into a more generic concept of "storage backends", (of which
localStorage
is just one of several possible), and replaced the noop store with an in-memory storage that we fall back to if localStorage is not supported. Hope it's not too overengineered 馃槄Note: I also took the liberty of removing the
clear()
-method for now, as it's not currently needed. It should be pretty trivial to add later.