Closed cgarciae closed 9 years ago
I actually really like this idea, it is the dart way to do things and would really simplify the cursor class.
for example, instead of the toArray() method they toList() method is built right into streams, and really every other cursor method as well.
According to the docs
they they tell you
And your implementation a abides perfectly. But Dart is not JavaScript, we DO have streams so why not implement cursor as such? Instead it implements
IterableBase
(which seems resonable) but whenever I put it in a for loop like thisI get a
Response
object that is useless (no exposed fields or methods). I take that methods likemap
,where
, etc will also receive this type.With Dart
1.9.1
and an implementing cursor as aStream<Map>
(for example), usingasync/await
we could do things likeor even more sophisticated stuff using
async *
.