ListPathObserver(this.list, String path)
: _itemPath = path {
// TODO(jmesserly): delay observation until we are observed.
_sub = list.listChanges.listen((records) {
for (var record in records) {
_observeItems(record.addedCount - record.removed.length);
}
_scheduleReduce(null);
});
_observeItems(list.length);
_reduce();
}