Merged
Conversation
5273a64 to
5307a9f
Compare
092fdd9 to
3b5e9e4
Compare
8e67827 to
f1f7112
Compare
ada7576 to
88ede1e
Compare
5ddbca2 to
cea28a3
Compare
…all descendant contexts.
…oughts are loaded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Syncing with IndexedDB and Firebase is now handled mainly through two pieces of middleware:
The pushQueue is triggered and throttled whenever
state.thoughtsis changed. This is unchanged fromdev.The pullQueue (what I originally called
thoughtCache) is entirely new. It is triggered and throttled on every action, monitoring changes to visible thoughts. Whenever the visible thoughts change (e.g. when the cursor changes), visible thoughts and their children are queued up to be fetched from IndexedDB and Firebase. They are fetched asynchronously, one level at a time, then reconciled and merged withstate.thoughts.The
Parenttype has a new property:pending. This indicates that it has descendants that have not yet been pulled. When pending thoughts are made visible, they will be immediately added to the pull queue, triggering a fetch from the server. As we optimize this, we should be able to pull thoughts in the background as the user navigates, so that they rarely see a pending thought.Fixes #273.