let timeout = after(seconds: 4) race(when(fulfilled: fetch(url:url)).asVoid(), timeout).then { //… } 不過請注意,race 之中的兩個promise 都需要回傳同樣的數值。
確定! 回上一頁