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

Add fromFirestore support #2

Merged
merged 3 commits into from Jun 24, 2022
Merged

Add fromFirestore support #2

merged 3 commits into from Jun 24, 2022

Conversation

danReynolds
Copy link
Owner

@danReynolds danReynolds commented Jun 24, 2022

This PR introduces the fromFirestore API for filtering what fields returned from Firestore should be merged into the cache on the client. This is helpful if you've made cache writes on the client optimistically for fields you intend to persist to the server later, but in the meantime you need to refetch from the server.

Up until now, the assumption had been made that whatever comes back from the server is the source of truth and should overwrite what's in the cache. The fromFirestore API makes it possible to specify a custom merge function for when values come back from the server and to complements the toFirestore API that provides the opposite filtering of what values you want sent to the server.

@danReynolds danReynolds changed the title temp commit Add fromFirestore support Jun 24, 2022
@danReynolds danReynolds merged commit f971ffa into master Jun 24, 2022
@danReynolds danReynolds deleted the feature/fromFirestore branch June 24, 2022 03: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.

None yet

1 participant