Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fake delay in fetch

fetch() {   
    return axios.get('/rest/foo')
        .then(value => new Promise(resolve => {
                setTimeout(() => {
                    resolve(value);
                }, delayInMilliseconds);
            })
        );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fake #delay #fetch
ADD COMMENT
Topic
Name
2+2 =