2.0.1 • Published 4 years ago

mp-promise v2.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

mp-promise

api promisify

Installation

npm install --save mp-promise

Getting started

💨example:

import { promisifyAll, promisify } from 'mp-promise';

const asyncApi = promisifyAll(api)

const asyncFunc = promisify(func)

WechatMiniprogram Example

// typings/index.d.ts
/// <reference path="../node_modules/mp-promise/types/index.d.ts" />

type WxApi = Omit<WechatMiniprogram.Wx, "wxp">;
declare namespace WechatMiniprogram {
  interface Wx {
    wxp: OmitNever<MpApiAsyncAll<WxApi>>;
  }
}

// miniprogram/app.ts
import { promisifyAll } from "mp-promise";
wx.wxp = promisifyAll(wx);
2.0.1

4 years ago

2.0.0

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago