Ex const promises = Promise.all([promise1, promise2]); const timeoutPromise = new Promise((resolve, reject) => setTimeout(reject, 10000)); Promise.race([promises, timeoutPromise]).then(promiseresult => {}).catch(() => console.log('connection timeout'));
Обсуждают сегодня