invertase / react-query-firebase

React Query hooks for managing asynchronous operations with Firebase. Supports Authentication, Analytics, Firestore & Realtime Database.
https://react-query-firebase.invertase.dev
Apache License 2.0
385 stars 68 forks source link

Optimistic updates #52

Open cyrus25 opened 2 years ago

cyrus25 commented 2 years ago

How to implement optimistic updates using useFirestoreDocumentMutation hook?

hmtcelik commented 11 months ago

any update or advice ?

hmtcelik commented 9 months ago

in docs says:

All hooks are built upon the [useMutation] hook, making it super simple to handle loading states, success and errors.

so we basically can use this technic when do some mutation:

https://tanstack.com/query/v4/docs/react/guides/optimistic-updates

it was useful for me, so maybe can be for anyone too