StreamResultX<T> extension
Extensions for working with streams of Result values without unwrapping each event manually.
Properties
-
dataStream
→ Stream<
T> -
Available on Stream<
Emits only the Success events, unwrapped to their data.Result< , provided by the StreamResultX extensionT> >no setter
Methods
-
listenResult(
{required void onData(T data), required void onError(Failure failure), void onDone()?, bool? cancelOnError}) → StreamSubscription< Result< T> > -
Available on Stream<
Convenience for subscribing with separate success and error callbacks.Result< , provided by the StreamResultX extensionT> > -
mapStream<
R> (R transform(T data)) → Stream< Result< R> > -
Available on Stream<
Maps each successful event withResult< , provided by the StreamResultX extensionT> >transform, leaving errors untouched. -
whereError(
) → Stream< Result< T> > -
Available on Stream<
Emits only the Error events as full Results.Result< , provided by the StreamResultX extensionT> > -
whereSuccess(
) → Stream< Result< T> > -
Available on Stream<
Emits only the Success events as full Results. Useful when you want to keep the result wrapper for downstream chaining.Result< , provided by the StreamResultX extensionT> >