1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Use destructured signal (#10115)

This commit is contained in:
David Walsh 2020-12-23 10:15:07 -06:00 committed by GitHub
parent 64adcae08d
commit c42087d044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,10 @@
const fetchWithTimeout = ({ timeout = 120000 } = {}) => {
return async function _fetch(url, opts) {
const abortController = new window.AbortController()
const abortSignal = abortController.signal
const { signal } = abortController
const f = window.fetch(url, {
...opts,
signal: abortSignal,
signal,
})
const timer = setTimeout(() => abortController.abort(), timeout)