// 引入方法
import { promisifys, toPromisify } from './promisy.js'
// 以request举例,其他同理
promisifys.request({url: 'xxx'})
.then((res) => {
// TODO somethings
}).catch((err) => {
// TODO somethings
})
// 亦可以使用工厂方法构造自己的promise
const func = toPromisify(wx.xxx)
func(option)
.then((res) => {
// TODO somethings
}).catch((err) => {
// TODO somethings
})
-
Notifications
You must be signed in to change notification settings - Fork 1
xingyibiao/wx-promise
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
封装微信小程序原生api为返回promise
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published