every method

Future<bool> every(
  1. bool fn(
    1. dynamic value,
    2. int index,
    3. ArangoCursor self
    )
)

Implementation

Future<bool> every(
  bool Function(dynamic value, int index, ArangoCursor self) fn,
) async {
  var index = 0;
  while (_result.isNotEmpty || _hasMore) {
    while (_result.isNotEmpty) {
      final result = fn(_result.removeAt(0), index, this);
      index++;
      if (!result) return result;
    }
    if (_hasMore) await _more();
  }
  return true;
}