当前位置:网站首页>The wechat applet optimizes the native request through the promise of ES6
The wechat applet optimizes the native request through the promise of ES6
2022-04-23 15:07:00 【Ruirui junior】
stay request New in folder index.js
In need of page Page to introduce , For example, my home page rotation map data
Code :index.js
export const request = (params) => {
return new Promise((resolve,reject) => {
wx.request({
...params,
success:(result)=>{
resolve(result)
},
fail:(err)=>{
reject(err)
}
})
})
}
版权声明
本文为[Ruirui junior]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231408339547.html
边栏推荐
- Swift: entry of program, swift calls OC@_ silgen_ Name, OC calls swift, dynamic, string, substring
- 大文件如何快速上传?
- Role of asemi rectifier module mdq100-16 in intelligent switching power supply
- asp. Net method of sending mail using mailmessage
- [thymeleaf] handle null values and use safe operators
- Reptile exercises (1)
- Analysis of common storage types and FTP active and passive modes
- Error: unable to find remote key "17f718f726"“
- Explain TCP's three handshakes in detail
- Llvm - generate if else and pH
猜你喜欢
What is the role of the full connection layer?
Progress in the treatment of depression
Advanced version of array simulation queue - ring queue (real queuing)
Introduction to Arduino for esp8266 serial port function
Detailed explanation of C language knowledge points -- data types and variables [1] - carry counting system
MySQL error packet out of order
Detailed comparison between asemi three-phase rectifier bridge and single-phase rectifier bridge
Basic operation of sequential stack
Explain TCP's three handshakes in detail
eolink 如何助力远程办公
随机推荐
Redis cluster principle
win10 任务栏通知区图标不见了
中富金石财富班29800效果如何?与专业投资者同行让投资更简单
8.3 language model and data set
JS -- realize click Copy function
Leetcode167 - sum of two numbers II - double pointer - bisection - array - Search
Detailed explanation of C language knowledge points -- data types and variables [1] - carry counting system
go基础 反射
Error: unable to find remote key "17f718f726"“
Leetcode149 - maximum number of points on a line - Math - hash table
eolink 如何助力遠程辦公
分享3个使用工具,在家剪辑5个作品挣了400多
Is asemi ultrafast recovery diode interchangeable with Schottky diode
Role of asemi rectifier module mdq100-16 in intelligent switching power supply
Mysql连接查询详解
How does eolink help telecommuting
LeetCode149-直线上最多的点数-数学-哈希表
Alexnet model
Swift - literal, literal protocol, conversion between basic data types and dictionary / array
[proteus simulation] automatic range (range < 10V) switching digital voltmeter