我在网上看到很多关于fetch timeout的封装,但是我觉得是伪timeout,只是抛错,但是fetch的Promise链会一直执行下去 Promise.race([ fetch('/api') .then(res => res.json()) .then(res => console.log(555)), new Promise(function(resolve, reject) { setTimeout(() => { reject(new...
我在网上看到很多关于fetch timeout的封装,但是我觉得是伪timeout,只是抛错,但是fetch的Promise链会一直执行下去 Promise.race([ fetch('/api') .then(res => res.json()) .then(res => console.log(555)), new Promise(function(resolve, reject) { setTimeout(() => { reject(new...