当前位置:网站首页>Promise async/await
Promise async/await
2022-06-30 07:10:00 【inlectrivet】
Promise Receive a function to do , This function receives resolve,reject These two functions are used as arguments
Promise Give asynchronous operations a state :
EH I haven't started the operation yet , The status is pending
The asynchronous operation was successfully executed resolve function , The status is fullfilled
Asynchronous operation failed to execute reject function , The status is rejected
To facilitate chained calls , He will return to a new promise Object and wrap the results of the asynchronous operation
.then Method passes two callback functions as parameters
The first function is used to execute a successful callback , The second function is used to execute the failed callback
.catch It is triggered when an error occurs at any stage , And the back then Will not proceed with
.finally Execute after the chain call , Whether the execution fails or not
async/await Is based on promise The grammar sugar of
async Mark a function as asynchronous , Can be used in await Call other asynchronous functions ,await Will be in promise After completion, return to the final result directly
边栏推荐
- NFS mount
- 社招两年半10个公司28轮面试面经
- How crazy are young people in sideline industry: 3000 monthly salary and 3W sideline income
- 大学刚毕业不知道做什么工作怎么办?
- 经纬恒润再次荣获PACCAR集团 10PPM 质量奖
- [my advanced OpenGL learning journey] about the access methods of vector and matrix classification of OpenGL shaders: xyzw/rgba/stpq and array subscripts
- 【申博攻略】五.专家推荐信模板
- [semidrive source code analysis] [x9 chip startup process] 34 - RTOS side display module SDM_ display_ Init display initialization source code analysis
- 2021-07-02
- The maximum expression in Oracle database message list is 1000 error
猜你喜欢

Egret P2 pit encountered by physical engine (1)

Linux服務器安裝Redis

QT common macro definitions

Google Earth engine (GEE) - Murray global tidal wetland change V1 (1999-2019) data set

Win10踩坑-开机0xc0000225

leetcode:98. 验证二叉搜索树
![[most complete] install MySQL on a Linux server](/img/5d/8d95033fe577c161dfaedd2accc533.png)
[most complete] install MySQL on a Linux server

vs2019和sql
![[hot100] palindrome substring and longest palindrome substring](/img/a5/10dec640f02023c4d55cb42e6309fb.png)
[hot100] palindrome substring and longest palindrome substring

Google Earth Engine(GEE)——墨累全球潮汐湿地变化 v1 (1999-2019) 数据集
随机推荐
Resolved: initialize specified but the data directory has files in it Aborting
failed to create symbolic link ‘/usr/bin/mysql’: File exists
Connection Flood攻击原理
第一行代码(第三版)学习笔记
免实名域名是什么意思?
js创建pdf文件
[introduction to Expo application] v Expert recommendation letter template
Four great happenings on earth
Jingwei Hengrun won the 10ppm quality award of paccar group again
如果我在珠海,到哪里开户比较好?另外,手机开户安全么?
Solr search
Nested if statement in sum function in SQL Server2005
2、 Layout system
1285_ Expand macros defined by AUTOSAR functions and variables with scripts to improve readability
Determine whether the picture is in JPG picture format
[datawhale team learning] task02: mathematical operation, string and text, list
[most complete] install MySQL on a Linux server
grep命令用法
Use of sscanf function
The solution of memcpy memory overlap