1.0.0-1 • Published 8 years ago

wx-promise v1.0.0-1

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

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