listen method
Adds a subscription to this Store
.
Each time this Store
triggers (by calling trigger
), indicating that
data has been mutated, onData
will be called.
If the Store
has been disposed, this method throws a StateError.
It is the caller's responsibility to cancel the subscription when needed.
Implementation
@override
StreamSubscription<Store> listen(StoreHandler? onData,
{Function? onError, void onDone()?, bool? cancelOnError}) {
if (isDisposed) {
throw StateError('Store of type $runtimeType has been disposed');
}
return _stream.listen(onData,
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
}