autoStream<T> method
Implementation
Future autoStream<T>(LifecycleCallback<Stream<T>> stream,
{bool cancelOnError = false}) async {
onStartup(() async {
final subscribe = (await stream()).listen((_) {}, cancelOnError: false);
onShutdown(() async {
await subscribe.cancel();
});
});
}