Is there an option for react-firebase to support delta change of QuerySnapshot to cherry-pick and update only the affected documents (added, modified, deleted) in the local copy?
react-firestore version: 1.0.1
node version: v8.16.0
npm (or yarn) version: 1.19.1
Relevant code or config
The current FirebaseCollection.handleOnSnapshotSuccess() is directly updating the state by replacing the data in case of even minor updates of the collection.
What you did:
MUI-Datatable wrapped in FirebaseCollection and data is shared between the components.
What happened:
Upon internal (from within the app) or external change of the data (another app user) the Datatable widget will re-render fully.
Problem description:
In case consumer widget is relying on state of data the component must re-render fully breaking the flow unexpectedly. In my app the FirebaseCollection feeds MUI-Datatable and change of underlying data re-renders the full table and loosing the state of the table.
Suggested solution:
- Use
docChange() and a different state management approach,
useReducer to delegate state management to consumer,
- any other option?
Is there an option for
react-firebaseto support delta change ofQuerySnapshotto cherry-pick and update only the affected documents (added, modified, deleted) in the local copy?react-firestoreversion: 1.0.1nodeversion: v8.16.0npm(oryarn) version: 1.19.1Relevant code or config
The current
FirebaseCollection.handleOnSnapshotSuccess()is directly updating the state by replacing thedatain case of even minor updates of the collection.What you did:
MUI-Datatable wrapped in FirebaseCollection and
datais shared between the components.What happened:
Upon internal (from within the app) or external change of the data (another app user) the Datatable widget will re-render fully.
Problem description:
In case consumer widget is relying on state of
datathe component must re-render fully breaking the flow unexpectedly. In my app the FirebaseCollection feeds MUI-Datatable and change of underlying data re-renders the full table and loosing the state of the table.Suggested solution:
docChange()and a different state management approach,useReducerto delegate state management to consumer,