w3cj/use-x

Use provided `AbortSignal` or omit it from `initialOptions` type definition

Opened this issue · 1 comments

There would be better to allow use also original Abort Signal (if provided):

const requestInit = (requestOptions || {});
requestInit.signal = abortController.current.signal;

 	 const requestInit = (requestOptions || {}); 
	 requestInit.signal = requestInit.signal ? mergeSignals(requestInit.signal, abortController.current.signal) : abortController.current.signal; 

…using https://www.npmjs.com/package/abort-utils

w3cj commented

Thanks! I will add this and a test soon. Will use the new built in AbortSignal.any() - https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static