Great article! However I don't see why you couldn't use the AbortController even if you're not using fetch. You'd just check for the abortController.signal.aborted flag in whatever resolve or reject block you get from the Promise.
Thanks - yes that's possible - however in that case the AbortController instance basically acts like a boolean flag. 😅
it can be helpful in certain scenarios though. if you are working with a lot of Promises - I'd recommend checking out npmjs.com/package/cancelable-promise
Great article! However I don't see why you couldn't use the AbortController even if you're not using
fetch. You'd just check for theabortController.signal.abortedflag in whateverresolveorrejectblock you get from thePromise.Thanks - yes that's possible - however in that case the
AbortControllerinstance basically acts like a boolean flag. 😅it can be helpful in certain scenarios though. if you are working with a lot of Promises - I'd recommend checking out npmjs.com/package/cancelable-promise
Whoah, that library looks like just what I was looking for. Thanks!