ValueStreamExtensions<T> extension

Extensions to easily access value and error.

on

Properties

error Object?
Last emitted error, or null if no error added or value exists.
no setter
hasError bool
A flag that turns true as soon as at an error event has been emitted.
no setter
hasValue bool
A flag that turns true as soon as at least one event has been emitted.
no setter
requireError Object
Returns last emitted error, failing if there is no error. Throws StateError if no error added or value exists.
no setter
requireValue → T
Returns last emitted value, failing if there is no value. Throws error if hasError. Throws StateError, if neither hasData nor hasError.
no setter
value → T?
Returns last emitted value, or null if there has been no emission yet.
no setter