Hi there!
How do i use AbortController with the fetch client? Most examples say
const fetchPromise = fetch(url, {signal});
But second parameter is where i have an object for method, headers, body, etc.
Hi there!
How do i use AbortController with the fetch client? Most examples say
const fetchPromise = fetch(url, {signal});
But second parameter is where i have an object for method, headers, body, etc.
That is correct, signal is a property on that object
Create an abort signal and assign that signal to the signal property of the object
var controller = new AbortController();
var signal = controller.signal;