Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

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
1+6 =