Skip to content
New issue

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

[js] 第598天 promise有哪几种状态?是如何变化的? #3265

Open
haizhilin2013 opened this issue Dec 3, 2020 · 3 comments
Open
Labels
js JavaScript

Comments

@haizhilin2013
Copy link
Collaborator

第598天 promise有哪几种状态?是如何变化的?

3+1官网

我也要出题

@haizhilin2013 haizhilin2013 added the js JavaScript label Dec 3, 2020
@zsgww
Copy link

zsgww commented Dec 4, 2020

待定(pending): 初始状态。
已兑现(fulfilled):操作成功。
已拒绝(rejected):操作失败。
从pending到fulfilled,或者pending到rejected。

@wChenonly
Copy link

1.pending(初始状态)
2.调用resolve(成功),pending->fulfilled
3.调用reject(失败),pending->rejected
而且状态改变以后,就不能在变了

@a62527776a
Copy link

Promis分别有pending 状态 fulfilled状态 以及rejected状态
当调用resolve或者reject之后的就会变为 转为相应的状态 这两种状态 又称 settled状态

进入settled状态 会触发finally回调

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
js JavaScript
Projects
None yet
Development

No branches or pull requests

4 participants