FriendForce / friendforce

1 stars 0 forks source link

Use Firebases's offline persistence instead of manual diffing #36

Open micahcatlin opened 6 years ago

micahcatlin commented 6 years ago

This article has a good explanation. The idea is that we should set up the initialization of our react app so that it registers a callback with the DataStore. The DataStore can then notify the app when "anything changes", and use a "snapshot listener" with firestore.

In that situation, we can expect the initial page load of the app to be closely followed by a snapshot update that comes from the browser's localstorage (in the internal implementation of firestore)

https://firebase.google.com/docs/firestore/manage-data/enable-offline