当前位置:网站首页>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
边栏推荐
- Authority management system
- Go项目目录结构介绍
- If I am in Zhuhai, where can I open an account? In addition, is it safe to open a mobile account?
- [Hot100]10. Regular Expression Matching
- 解决:div获取不到键盘事件
- Nested if statement in sum function in SQL Server2005
- 六,购物⻋与订单
- Resolved: initialize specified but the data directory has files in it Aborting
- Linu foundation - zoning planning and use
- 社招两年半10个公司28轮面试面经
猜你喜欢

The first up Master of station B paid to watch the video still came! Price "Persuading" netizens

Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)

SOC project AHB_ SD_ Host controller design

How to determine the size of the platform byte order?

经纬恒润再次荣获PACCAR集团 10PPM 质量奖

Go项目目录结构介绍

MySQL Optimization: from more than ten seconds to 300 milliseconds

【我的OpenGL学习进阶之旅】关于OpenGL的着色器的向量和矩阵分类的访问方式: xyzw/rgba/stpq以及数组下标

大学刚毕业不知道做什么工作怎么办?

编写并运行第一个Go语言程序
随机推荐
How crazy are young people in sideline industry: 3000 monthly salary and 3W sideline income
[implemented] server jar package startup script and shell script
Steps for formulating class or file templates in idea
Pit stepping record: Supervisor log return information: redis extension is not installed
Browser downloads files as attachments
First line of code (Third Edition) learning notes
Class templates and friends
ROS service communication programming
The solution of memcpy memory overlap
汇编语言学习一(有栈协程铺垫,32位寄存器和相关指令学习,未完待续06/29)
大学刚毕业不知道做什么工作怎么办?
Ftplib+ tqdm upload and download progress bar
经纬恒润再次荣获PACCAR集团 10PPM 质量奖
Use of sscanf function
Write about your feelings about love and express your emotions
ROS-URDF
Records of problems solved (continuously updated)
IDEA import导入的类明明存在,却飘红?
Go常用命令
Mysql5.7 compressed version installation tutorial