当前位置:网站首页>Use of promise

Use of promise

2020-12-07 17:40:34 Icecream

promise There are three states
1、pending Preparation stage
2、resolve Success status
3、reject Failure status

`new Promise((resolve, reject)=>{

//  When there is no return  resolve  or  reject  when ,  yes  pending  state 

})`

`new Promise((resolve, reject)=>{

resolve();
reject();
// promise Once the state changes ,  It won't change ,  So only the first successful call is executed 

})`

版权声明
本文为[Icecream]所创,转载请带上原文链接,感谢
https://chowdera.com/2020/12/202012071739425808.html