-
Notifications
You must be signed in to change notification settings - Fork 213
Open
Description
Hi, new dart beginner here. As far as I can see, the widget update process will spawn a stream which could be cancelled both when ignoreChange
implemented, and distinct
is set true
. I'm not seeing any difference using one of the two, and confused about it. Not sure if there is any consideration I've missed?
void _createStream() {
_stream = widget.store.onChange
.where(_ignoreChange)
.map((_) => widget.converter(widget.store))
.transform(StreamTransformer.fromHandlers(
handleError: _handleConverterError,
))
// Don't use `Stream.distinct` because it cannot capture the initial
// ViewModel produced by the `converter`.
.where(_whereDistinct)
// After each ViewModel is emitted from the Stream, we update the
// latestValue. Important: This must be done after all other optional
// transformations, such as ignoreChange.
.transform(StreamTransformer.fromHandlers(
handleData: _handleChange,
))
// Handle any errors from converter/onWillChange/onDidChange
.transform(StreamTransformer.fromHandlers(
handleError: _handleError,
));
}
Metadata
Metadata
Assignees
Labels
No labels