wx-promise

1.0.0-1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i wx-promise

Weekly Downloads

0

Version

1.0.0-1

License

ISC

Last publish

Collaborators

  • xinchaobeta