Skip to content

Commit c86dc0f

Browse files
committed
support custom provided promise
1 parent 3ea0f63 commit c86dc0f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/cursor/abstract_cursor.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ export abstract class AbstractCursor extends EventEmitter {
178178

179179
[Symbol.asyncIterator](): AsyncIterator<Document | null> {
180180
return {
181-
next: async () => {
182-
const value = await this.next();
183-
return { value, done: value === null };
184-
}
181+
next: () => this.next().then(value => ({ value, done: value === null }))
185182
};
186183
}
187184

0 commit comments

Comments
 (0)