notifyDocuments method
void
notifyDocuments(
- String path,
- String key,
- DynamicMap value,
- LocalStoreDocumentUpdateStatus status,
- 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,
),
),
);
}
}