Taking this example from the Dart docs. Is there a way to make timedCounter() return a broadcast stream by definition?
Stream<int> timedCounter(Duration interval, [int? maxCount]) async* {
int i = 0;
while (true) {
await Future.delayed(interval);
yield i++;
if (i == maxCount) break;
}
}
Not looking for timedCounter().asBroadcastStream() nor with using a StreamController.
This question is more about if the syntax of defining a function with async* limits the result stream to be a single subscription.