toStream method

Stream<T> toStream()

Implementation

Stream<T> toStream() async* {
  final iterator = jsu.getProperty(this, _asyncIterator);
  final callable = jsu.callMethod(iterator, 'call', []);

  while (true) {
    final result = await _next(callable);
    if (result.done) {
      break;
    }
    yield result.value;
  }
}