Skip to content

Conversation

@lowlighter
Copy link
Contributor

Close #6970

Make it so the abortable() can be called with both of these manners:

await abortable(promise, signal)
await abortable(promise, { signal })

The second one which is introduced, is close to the options object already supported by deadline/delay, making it easier for libraries developpers to reuse the same object by unifying these differents APIs, and also avoiding the burden of checking whether their promise must be wrapped by abortable or not depending on whether the signal is provided or not

async function foo(options: { signal?: AbortSignal } = {}) {
  await delay(100, options)
  await abortable(promise, options)
  await deadline(another_promise, options)
}

@lowlighter lowlighter requested a review from kt3k as a code owner January 25, 2026 20:09
@github-actions github-actions bot added the async label Jan 25, 2026
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.20%. Comparing base (4d438dc) to head (8f0f43f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6971      +/-   ##
==========================================
+ Coverage   94.19%   94.20%   +0.01%     
==========================================
  Files         600      601       +1     
  Lines       43290    43343      +53     
  Branches     6961     6973      +12     
==========================================
+ Hits        40776    40831      +55     
+ Misses       2459     2458       -1     
+ Partials       55       54       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider allowing signal with abortable optional and a no-op

1 participant