Skip to content

axetroy/wxapp-promisify

Repository files navigation

wxapp-promisify

Greenkeeper badge Build Status Dependency License Prettier Node npm version

让微信小城的对全局对wx的api返回promise.

对所有api增加Async后缀,则调用异步api,并且返回promise.

Installation

npm install wxapp-promisify

Usage

// es6
import wx from '@axetroy/wxapp-promisify';

// commandJS
var wx = require('@axetroy/wxapp-promisify');

wx
  .getUserInfoAsync()
  .then(function(userInfo) {
    console.log(userInfo);
  })
  .catch(function(err) {
    console.error(err);
  });

wx
  .showToastAsync({ title: 'This is title' })
  .then(function(res) {})
  .catch(function(err) {});
git clone https://github.com/axetroy/wxapp-promisify.git
cd ./wxapp-promisify
yarn

You can flow Contribute Guide

Contributors


Axetroy

💻 🔌 ⚠️ 🐛 🎨

License

The MIT License

About

微信小程序wx对象的API,promise化

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published