Closed mohit-sentieo closed 4 years ago
Without async/await I would do this:
db.transaction(storeName).store.openCursor().then(function handleCursor(cursor) {
console.log(cursor.key, cursor.value);
return cursor.continue().then(handleCursor);
}).then(() => {
console.log('done!');
});
Please reopen if that isn't the answer you're looking for!
I would like to iterate over a cursor. But unfortunately our large code base does not use async/await and this is causing a problem. I have decided to do something like this https://gist.github.com/mohit-sentieo/e161aa4fe5ac0eb1cbfb2579b62fb5f4
But this doesn't seem to be working. There should be a way to iterate over cursor without Promise recursion.