SniberbS
Reactiflux3y ago
13 replies
Sniberb

snowberb – 10-37 Jun 15

Im trying to use AbortController but I cant find out how it really works. If I put it before the fetch, the fetch request gets ignored, it doesnt even start. And if I put it after the fetch, it will simply await the call without aborting. Any ideas?
const controller = new AbortController()

const handleInputChange = async (values) => {
  controller.abort()
  await fetch({values, signal})
}

return <Select onChange={handleInputChange} />
Was this page helpful?