updateLocalDoc method

  1. @protected
T updateLocalDoc({
  1. required String id,
  2. required UpdateDocDef<T> doc,
  3. bool doNotifyListeners = true,
})

Updates an existing document in local state.

Parameters:

  • id - The ID of the document to update
  • doc - The definition of how to update the document
  • doNotifyListeners - Whether to notify listeners of the change

Implementation

@protected
T updateLocalDoc({
  required String id,
  required UpdateDocDef<T> doc,
  bool doNotifyListeners = true,
}) {
  log.debug('Updating local doc with id: $id');
  final pDoc = doc(
    findById(id),
    turboVars(id: id),
  );
  docsPerIdInformer.updateCurrent(
    (value) => value
      ..update(
        pDoc.id,
        (_) => pDoc,
      ),
    doNotifyListeners: doNotifyListeners,
  );
  return pDoc;
}