0.1.0 • Published 7 years ago

@axetroy/wxapp-promisify v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
7 years ago

wxapp-promisify

Build Status Dependency License Prettier Node npm version

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

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

Installation

npm install wxapp-promisify

Features

  • 存储绝大多数的数据类型(微信原生对象只支持object/string)
  • 设置有存储时限
  • 优雅的API

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