geofirex
geofirex copied to clipboard
Support data from server or cache
The most common example is search result list.
Usually, the search result list should return the first updated data using get
function because we don't want that the list is always changing.
Therefore the source option is very important. If the first return data is from cache. It means no chance to get updated data from server again by using get
function.
Provide a source option can help developer to customize the cache policy. please refer the following document. https://firebase.google.com/docs/reference/js/firebase.firestore.GetOptions
And also the includeMetadataChanges: true
setting is necessary. the reason is below:
https://firebase.google.com/docs/firestore/manage-data/enable-offline