wx-promise
v1.0.0-1
Published
just make official jssdk return a promise
Downloads
2
Readme
Introduction
The traditional wechat jssdk coding style is not convenient, as below:
wx.ready(function() {
wx.getNetworkType({
success: function (res) {
var networkType = res.networkType; // 返回网络类型2g,3g,4g,wifi
//...
}
});
})
This project make each wechat jssdk function return a promise
.Now you write like as below ( only one line ) :
// ES7
const {networkType} = await wx.getNetworkType()
Build Setup
# build for publish
make build
# run unit tests
make test