Answers for "fetch timeout"

-1

fetch timeout

function timeoutFetch(promise) {
    return new Promise(function (resolve, reject) {
        setTimeout(function () {
            reject(new Error("timeout"))
        }, 5000)
        promise.then(resolve, reject)
    })
}
Posted by: Guest on February-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language