map<T> method

Stream<T> map<T>(
  1. T fn(
    1. dynamic value,
    2. int index,
    3. ArangoCursor self
    )
)

Implementation

Stream<T> map<T>(
  T Function(dynamic value, int index, ArangoCursor self) fn,
) async* {
  var index = 0;
  while (_result.isNotEmpty || _hasMore) {
    while (_result.isNotEmpty) {
      yield fn(_result.removeAt(0), index, this);
      index++;
    }
    if (_hasMore) await _more();
  }
}