nodes.subUpdates.listen((e) async {
if (e.subName != 'samples' || e.ancestry.length != 2) return;
final sample = await nodes.getDescendant<StatSample>(
ancestry: e.ancestry, // [host CAncestor, atSign CAncestor]
id: e.id, // <millis>
owner: e.owner, // sender atSign
leafExpiration: ttl,
leafFromJson: StatSample.fromJson,
leafTypeTag: 'StatSample',
);
if (sample != null) window.add(sample.obj);
});
subUpdate, at any depth.getDescendant walks the parent chain in a single call. It replaces a hand-coded getOrNull → subCollection → getOrNull → subCollection → getOrNull ladder.null if any link in the chain is missing, expired, or has availableAt in the future. The receiver retries on the next event without exception handling or special cases.That's the entire receive loop. The Flutter dashboard does this plus chart rendering in around 100 lines.