Add timeoutSignal function
#363
aleclarson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It combines
new AbortController()withtimeoutand returns the signal.Alternatives
abortIfRejected(promise)function instead, which returns an abort signal that aborts if the given promise rejects. You could doabortIfRejected(timeout(30e3))to achieve the same thing as the proposedtimeoutSignalfunction.promiseToSignal,toAbortSignalBeta Was this translation helpful? Give feedback.
All reactions