SunnyObservableList<V>.ofVStream constructor
SunnyObservableList<V>.ofVStream (})
Implementation
SunnyObservableList.ofVStream(ValueStream<Iterable<V>> stream,
{this.diffEquality = const DiffEquality(), String? debugLabel})
: debugLabel = debugLabel ?? "stream[${V.name}]",
super() {
this.sync(stream.get()).then((_) {
final subscription = stream.listen(
(newList) {
try {
log.info(
"[$debugLabel] got sync event from upstream with ${newList.length} records");
this.sync(newList);
} catch (e) {
print(e);
}
},
);
disposers.add(subscription.cancel);
});
}