wechat-minapp-promise

1.0.0 • Public • Published

微信小程序 API Promise 封装

用于将微信小程序无接口请求, API异步函数封装为 Promise 风格

使用方法比如:

常用的API, 例如wx.login

const promisify from 'index.js'
const login = promisify(wx.login)

login()
.then(res => {
console.log(res.code)
})

网络请求:wx.request()

const promisify from 'index.js';
const wxRequest = promisify(wx.request)

wxRequest({
	urll,
	data,
	method
})
.then(() => {})
.catch(() => {})

Readme

Keywords

Package Sidebar

Install

npm i wechat-minapp-promise

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

1.5 kB

Total Files

4

Last publish

Collaborators

  • limanman