toss / es-toolkit

A modern JavaScript utility library that's 2-3 times faster and up to 97% smaller—a major upgrade to lodash.
https://es-toolkit.slash.page
Other
6.25k stars 263 forks source link

fix(delay): Ensure event listener is removed after timeout #456

Closed mass2527 closed 2 weeks ago

mass2527 commented 2 weeks ago

Currently, if a signal is passed but not aborted, the event listener will not be removed, since the event listener with the once option is only automatically removed when it is invoked.

Therefore, I have updated the code to explicitly remove the event listener when a timeout occurs.

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2024 9:04am
codecov-commenter commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.77%. Comparing base (5925521) to head (d5fa4d2).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/toss/es-toolkit/pull/456/graphs/tree.svg?width=650&height=150&src=pr&token=8N5S3AR3C7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toss)](https://app.codecov.io/gh/toss/es-toolkit/pull/456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toss) ```diff @@ Coverage Diff @@ ## main #456 +/- ## ========================================== + Coverage 99.70% 99.77% +0.07% ========================================== Files 168 168 Lines 1348 1350 +2 Branches 360 360 ========================================== + Hits 1344 1347 +3 + Misses 3 2 -1 Partials 1 1 ```