当前位置:网站首页>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
边栏推荐
- Nuxt project: Global get process Env information
- Llvm - generate for loop
- Detailed explanation of C language knowledge points -- data types and variables [1] - carry counting system
- JUC学习记录(2022.4.22)
- Thread synchronization, life cycle
- ffmpeg安装遇错:nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
- Have you really learned the operation of sequence table?
- Programming philosophy - automatic loading, dependency injection and control inversion
- js——實現點擊複制功能
- Difference between like and regexp
猜你喜欢
Have you really learned the operation of sequence table?
Detailed explanation of C language knowledge points -- first understanding of C language [1] - vs2022 debugging skills and code practice [1]
TLS / SSL protocol details (28) differences between TLS 1.0, TLS 1.1 and TLS 1.2
Swift - literal, literal protocol, conversion between basic data types and dictionary / array
OC to swift conditional compilation, marking, macro, log, version detection, expiration prompt
UML learning_ Day2
8.5 concise implementation of cyclic neural network
The win10 taskbar notification area icon is missing
Role of asemi rectifier module mdq100-16 in intelligent switching power supply
[NLP] HMM hidden Markov + Viterbi word segmentation
随机推荐
A series of problems about the best time to buy and sell stocks
Resolve the conflict between computed attribute and input blur event
免费在upic中设置OneDrive或Google Drive作为图床
js——實現點擊複制功能
How does eolink help telecommuting
Thinkphp5 + data large screen display effect
go基础 反射
Reptile exercises (1)
小红书 timestamp2 (2022/04/22)
Contraction mapping theorem
脏读、不可重复读和幻读介绍
C语言超全学习路线(收藏让你少走弯路)
Error: unable to find remote key "17f718f726"“
UML学习_day2
SQL中HAVING和WHERE的区别
What is the role of the full connection layer?
Compiling OpenSSL
JS - implémenter la fonction de copie par clic
Realization of four data flow modes of grpc based on Multilingual Communication
每日一题-LeetCode396-旋转函数-递推