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
-
It combines
new AbortController()
withtimeout
and 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 proposedtimeoutSignal
function.promiseToSignal
,toAbortSignal
Beta Was this translation helpful? Give feedback.
All reactions