listen method
Listens for events on the stream.
Implementation
MiniSubscription<T> listen(
void Function(T event) onData, {
Function? onError,
void Function()? onDone,
bool cancelOnError = false,
}) {
final MiniSubscription<T> subs = MiniSubscription<T>(
onData,
onError,
onDone,
cancelOnError,
listenable,
);
listenable.addListener(subs);
return subs;
}