Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fetch timeout

function timeoutFetch(promise) {
    return new Promise(function (resolve, reject) {
        setTimeout(function () {
            reject(new Error("timeout"))
        }, 5000)
        promise.then(resolve, reject)
    })
}
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #fetch #timeout
ADD COMMENT
Topic
Name
4+5 =