You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,
));
}
The text was updated successfully, but these errors were encountered:
Fnll
changed the title
Any thoughts on difference between ignoreChange and distinct?
[Question]: Any thoughts on difference between ignoreChange and distinct?
Sep 16, 2022
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, anddistinct
is settrue
. 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?The text was updated successfully, but these errors were encountered: