Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 581 Bytes

README.md

File metadata and controls

38 lines (29 loc) · 581 Bytes

next-wx-promisify

Promisify for weixin/weapp succes/failed/complete

install:

npm install -S afeiship/next-wx-promisify --registry=https://registry.npm.taobao.org

usage:

import nxWxPromisify from 'next-wx-promisify';

const showSheet = (inOptions) => {
  return new Promise((resove, reject) => {
    wx.showActionSheet(nx.mix(nx.wxPromisify(resove, reject), inOptions));
  });
};

showSheet({
  itemsList:[0,1,2],
  complete: fn,
}).then({ code, data })

// when success:
{
  code: 0,
  data: data
}

// when failed:
{
  code: 1,
  data: data
}