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.08%. Comparing base (062aa94) to head (93c27eb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6971   +/-   ##
=======================================
  Coverage   94.08%   94.08%           
=======================================
  Files         600      601    +1     
  Lines       43553    43606   +53     
  Branches     6997     7009   +12     
=======================================
+ Hits        40977    41027   +50     
- Misses       2521     2523    +2     
- Partials       55       56    +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