1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | (function () {
|
7 | var version = "0.1.0";
|
8 |
|
9 | const whenx= function(){
|
10 | let _wx= {};
|
11 | for(let k in wx){
|
12 | if(typeof wx[k] === 'function'){
|
13 |
|
14 | _wx[k]= (v)=> whenx_1$$1.call(this, k, v);
|
15 | }
|
16 | }
|
17 | return _wx
|
18 | }();
|
19 |
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 | var whenx_1$$1= whenx;
|
26 |
|
27 | var whenx$1 = ({
|
28 | default: whenx_1$$1,
|
29 | __moduleExports: whenx_1$$1
|
30 | });
|
31 |
|
32 | const thenx= (name, opts= {})=>{
|
33 |
|
34 | return new Promise((resolve, reject)=>{
|
35 | wx[name]( Object.assign(opts, {
|
36 | success: res=> resolve(res)
|
37 | ,fail: err=> reject(err)
|
38 | ,complete: opts.complete
|
39 | }) );
|
40 | })
|
41 | };
|
42 |
|
43 | |
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | var thenx_1= thenx;
|
51 |
|
52 | var thenx$1 = ({
|
53 | default: thenx_1,
|
54 | __moduleExports: thenx_1
|
55 | });
|
56 |
|
57 | let main$1= whenx$1;
|
58 |
|
59 | main$1.whenx= whenx$1;
|
60 | main$1.thenx= thenx$1;
|
61 | main$1.version= version;
|
62 |
|
63 | |
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | module.exports= main$1;
|
71 |
|
72 | }());
|