We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
第490天 如何取消promise?
3+1官网
我也要出题
The text was updated successfully, but these errors were encountered:
promise的状态一经确定就不能被取消了
Sorry, something went wrong.
Promise/A+标准规定了:原Promise对象跟新返回的对象状态一致。所以可以通过返回一个始终是pending状态的Promise对象来取消Promise。 Promise.resolve().then(() => { console.log(1) return new Promise(()=>{}) // 返回“pending”状态的Promise对象 }).then(() => { // 后续的函数不会被调用 console.log(2) }).catch(err => { console.log(err) }) // 只输出1
No branches or pull requests
第490天 如何取消promise?
3+1官网
我也要出题
The text was updated successfully, but these errors were encountered: