Skip to content

Commit

Permalink
start iteration immediately, with a just-in-case .catch(..)
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche authored and imbstack committed Apr 9, 2019
1 parent 230da65 commit 700c019
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/iterate/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ class Iterate extends events.EventEmitter {

return new Promise(resolve => {
this.once('started', resolve);
process.nextTick(() => this.iterate());
// start iteration; any failures here are a programming error in this
// library and so should be considered fatal
this.iterate().catch(err => this.emit('error', err));
});
}

Expand Down

0 comments on commit 700c019

Please sign in to comment.