miniprogram-promise
v0.0.19
Published
promise for Wechat MiniProgram
Downloads
5
Maintainers
Readme
miniprogram-promise
MiniProgram Promise Asynchronous API poly fill 在小程序中异步API Promise封装
Feathers:
- [x] finally Promise (支持Finally)
- [x] cancelable/abort (可取消的Promise)
Usage
import {cancelablePromisify} from 'miniprogram-promise';
request = cancelablePromisify(wx.request);
request({url:'xxx'})
.then((res)=>{/**/})
.catch((errr)=>{})
.finally(()=>{});
request({url:'xxx'}).then().cancel()