Skip to content

Commit

Permalink
Remove useless setImmediate
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak authored Nov 18, 2019
1 parent e1eb161 commit d7e7bd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/request-as-event-emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export default (options: NormalizedOptions) => {
}
};

setImmediate(async () => {
(async () => {
try {
for (const hook of options.hooks.beforeRequest) {
// eslint-disable-next-line no-await-in-loop
Expand All @@ -314,7 +314,7 @@ export default (options: NormalizedOptions) => {
} catch (error) {
emitError(error);
}
});
})();

return emitter;
};
Expand Down

0 comments on commit d7e7bd3

Please sign in to comment.