Skip to content

Instantly share code, notes, and snippets.

@marr
Created June 19, 2019 19:18
Show Gist options
  • Save marr/163c7a03d75e404a15f459846d5b2f2d to your computer and use it in GitHub Desktop.
Save marr/163c7a03d75e404a15f459846d5b2f2d to your computer and use it in GitHub Desktop.
const controller = new AbortController()
const signal = controller.signal
setTimeout(() => {
controller.abort()
}, 1000)
fetch(url, { signal })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment