Skip to content

Conversation

@lwin-kyaw
Copy link
Contributor

Clean up setTimeout() after network request promise is resolved within timeout period.

src/index.ts Outdated
});
return Promise.race<T>([promise, timeout]);

const result = await Promise.race<T>([promise, timeout]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the original promise rejects, Promise.race throws and timeout is not cleared.

Copy link
Member

@chaitanyapotti chaitanyapotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chaitanyapotti chaitanyapotti merged commit c82e479 into MetaMask:master Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants