A fetch() can be made cancellable by passing an AbortSignal "signal" in the fetch options. Calling abort() on the associated AbortController will then cancel the fetch.
Docs: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal https://developer.mozilla.org/en-US/docs/Web/API/AbortController
Samples: https://developers.google.com/web/updates/2017/09/abortable-fetch