notifyDocuments method

void notifyDocuments(
  1. String path,
  2. String key,
  3. DynamicMap value,
  4. LocalStoreDocumentUpdateStatus status,
  5. LocalStoreDocumentQuery query,
)

Implementation

void notifyDocuments(
  String path,
  String key,
  DynamicMap value,
  LocalStoreDocumentUpdateStatus status,
  LocalStoreDocumentQuery query,
) {
  final collectionPath = path.parentPath();
  if (_documentListeners.containsKey(path)) {
    _documentListeners[path]?.forEach(
      (element) => element.callback?.call(
        LocalStoreDocumentUpdate(
          path: path,
          id: key,
          status: status,
          value: Map.from(value),
          origin: query.origin,
        ),
      ),
    );
  }
  if (_collectionListeners.containsKey(collectionPath)) {
    _collectionListeners[collectionPath]?.forEach(
      (element) => element.callback?.call(
        LocalStoreDocumentUpdate(
          path: path,
          id: key,
          status: status,
          value: Map.from(value),
          origin: query.origin,
        ),
      ),
    );
  }
}