@ndriadev/futurable 1.0.8 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/futurable.cjs.js +1 -1
- package/dist/futurable.mjs.js +187 -164
- package/dist/index.d.ts +45 -41
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<div align="center">
|
|
12
12
|
|
|
13
13
|

|
|
14
|
-

|
|
15
15
|

|
|
16
16
|

|
|
17
17
|
</div>
|
package/dist/futurable.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var T=Object.defineProperty;var C=(y,g,t)=>g in y?T(y,g,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[g]=t;var S=(y,g,t)=>(C(y,typeof g!="symbol"?g+"":g,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class l extends Promise{constructor(t,e){const r=e?null:new AbortController,n=e||r.signal,o=[],c=()=>{for(const s of o)clearTimeout(s)};let i;const a={signal:n,cancel:()=>{var s;return(s=this.controller)==null?void 0:s.abort()},onCancel:s=>{i=s},delay:(s,u)=>new l(d=>{o.push(setTimeout(()=>{d(s())},u))},n),sleep:s=>a.delay(()=>{},s),fetch:(s,u)=>new l((d,j)=>{fetch(s,{...u||{},signal:n}).then(w=>d(w)).catch(w=>{w.name!=="AbortError"&&j(w)})},n),futurizable:s=>new l((u,d)=>{s.then(u).catch(d)},n)};let f="pending";const p=new Promise((s,u)=>{if(n.aborted){c(),f==="pending"&&i&&i();return}else{const d=typeof n.onabort=="function"?n.onabort:()=>{};n.onabort=()=>{d(),c(),f==="pending"&&i&&i()},t(m=>{f="fulfilled",s(m)},m=>{f="rejected",u(m)},a)}});super((s,u)=>{p.then(d=>s(d)).catch(u)});S(this,"controller");S(this,"internalSignal");S(this,"idsTimeout");this.controller=r,this.internalSignal=n,this.idsTimeout=o}static get[Symbol.species](){return this}get[Symbol.toStringTag](){return"Futurable"}get signal(){return this.internalSignal}clearTimeout(){for(const t of this.idsTimeout)clearTimeout(t)}then(t,e){let r,n;const o=new l((c,i)=>{r=c,n=i},this.internalSignal);return o.controller=this.controller,super.then(c=>{var i;if((i=this.internalSignal)!=null&&i.aborted){this.clearTimeout();return}try{r(t?t(c):c)}catch(h){n(h)}},c=>{var i;if((i=this.internalSignal)!=null&&i.aborted){this.clearTimeout();return}try{e?r(e(c)):n(c)}catch(h){n(h)}}),o}catch(t){return this.then(null,t)}finally(t){return this.then(e=>(t(),e),e=>(t(),e))}cancel(){var t,e;!((t=this.internalSignal)!=null&&t.aborted)&&((e=this.controller)==null||e.abort())}delay(t,e){let r,n;const o=new l((c,i)=>{r=c,n=i},this.internalSignal);return o.controller=this.controller,this.then(c=>{this.idsTimeout.push(setTimeout(()=>r(t(c)),e))},c=>{n(c)}),o}sleep(t){return this.delay(e=>e,t)}fetch(t,e){let r,n;const o=new l((c,i)=>{r=c,n=i},this.internalSignal);return o.controller=this.controller,this.then(c=>{const i=typeof t=="function"?t(c):t,h={...typeof e=="function"?e(c):e,signal:this.internalSignal};fetch(i,h).then(a=>r(a)).catch(a=>{a.name!=="AbortError"&&n(a)})}),o}onCancel(t){let e,r;const n=new l((o,c,i)=>{i.onCancel(t),e=o,r=c},this.internalSignal);return n.controller=this.controller,this.then(o=>e(o),o=>r(o)),n}futurizable(t){let e,r;const n=new l((o,c)=>{e=o,r=c},this.internalSignal);return n.controller=this.controller,this.then(o=>{(typeof t=="function"?t(o):t).then(e).catch(r)}),n}static resolve(t,e){return t?new l(r=>r(t),e):new l(r=>r(),e)}static reject(t,e){return new l((r,n)=>n(t),e)}static onCancel({cb:t,signal:e}){return new l((r,n,o)=>{o.onCancel(()=>r(t()))},e)}static delay({cb:t,timer:e,signal:r}){return new l((n,o,c)=>{c.delay(t,e).then(n,o)},r)}static sleep({timer:t,signal:e}){return l.delay({cb:()=>{},timer:t,signal:e})}static fetch(t,e){const r=(e==null?void 0:e.signal)||void 0;return e!=null&&e.signal&&delete e.signal,new l((n,o,c)=>{c.fetch(t,e).then(n)},r)}static futurizable({promise:t,signal:e}){return new l((r,n)=>{t.then(r).catch(n)},e)}static handleValues(t,e){const r=[];for(const n in t)t[n]instanceof l?r.push(t[n]):t[n]instanceof Promise?r.push(new l((o,c)=>{t[n].then(i=>o(i)).catch(c)},e)):r.push(new l(o=>o(t[n]),e));return r}static all(t,e){let r,n;const o=new l((i,h,a)=>{r=i,n=h,a.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=o.internalSignal);const c=l.handleValues(t,e);return super.all(c).then(i=>r(i)).catch(i=>n(i)),o}static allSettled(t,e){let r;const n=new l((c,i,h)=>{r=c,h.onCancel(()=>{for(const a of o)a.cancel()})},e);e||(e=n.internalSignal);const o=l.handleValues(t,e);return super.allSettled(o).then(c=>r(c)),n}static race(t,e){let r,n;const o=new l((i,h,a)=>{r=i,n=h,a.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=o.internalSignal);const c=l.handleValues(t,e);return super.race(c).then(i=>r(i)).catch(i=>n(i)),o}static any(t,e){let r,n;const o=new l((i,h,a)=>{r=i,n=h,a.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=o.internalSignal);const c=l.handleValues(t,e);return super.any(c).then(i=>r(i)).catch(i=>n(i)),o}}exports.Futurable=l;
|
package/dist/futurable.mjs.js
CHANGED
|
@@ -1,73 +1,62 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
10
|
-
h instanceof WeakSet ? h.add(i) : h.set(i, e);
|
|
11
|
-
};
|
|
12
|
-
var j = (i, h, e) => (z(i, h, "access private method"), e);
|
|
13
|
-
var D = /* @__PURE__ */ ((i) => (i.PENDING = "pending", i.FULFILLED = "fulfilled", i.REJECTED = "rejected", i))(D || {}), m, v;
|
|
14
|
-
const s = class extends Promise {
|
|
15
|
-
constructor(e, t) {
|
|
16
|
-
const r = t ? null : new AbortController(), n = t || r.signal, l = [], c = () => {
|
|
17
|
-
for (const a of l)
|
|
18
|
-
clearTimeout(a);
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
|
+
var C = (w, g, t) => g in w ? T(w, g, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[g] = t;
|
|
3
|
+
var S = (w, g, t) => (C(w, typeof g != "symbol" ? g + "" : g, t), t);
|
|
4
|
+
class l extends Promise {
|
|
5
|
+
constructor(t, e) {
|
|
6
|
+
const r = e ? null : new AbortController(), n = e || r.signal, o = [], c = () => {
|
|
7
|
+
for (const s of o)
|
|
8
|
+
clearTimeout(s);
|
|
19
9
|
};
|
|
20
|
-
let
|
|
21
|
-
const
|
|
10
|
+
let i;
|
|
11
|
+
const a = {
|
|
22
12
|
signal: n,
|
|
23
13
|
cancel: () => {
|
|
24
|
-
var
|
|
25
|
-
return (
|
|
14
|
+
var s;
|
|
15
|
+
return (s = this.controller) == null ? void 0 : s.abort();
|
|
26
16
|
},
|
|
27
|
-
onCancel: (
|
|
28
|
-
|
|
17
|
+
onCancel: (s) => {
|
|
18
|
+
i = s;
|
|
29
19
|
},
|
|
30
|
-
delay: (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
20
|
+
delay: (s, u) => new l((d) => {
|
|
21
|
+
o.push(setTimeout(() => {
|
|
22
|
+
d(s());
|
|
23
|
+
}, u));
|
|
34
24
|
}, n),
|
|
35
|
-
sleep: (
|
|
36
|
-
},
|
|
37
|
-
fetch: (
|
|
38
|
-
fetch(
|
|
39
|
-
|
|
25
|
+
sleep: (s) => a.delay(() => {
|
|
26
|
+
}, s),
|
|
27
|
+
fetch: (s, u) => new l((d, p) => {
|
|
28
|
+
fetch(s, { ...u || {}, signal: n }).then((y) => d(y)).catch((y) => {
|
|
29
|
+
y.name !== "AbortError" && p(y);
|
|
40
30
|
});
|
|
41
31
|
}, n),
|
|
42
|
-
futurizable: (
|
|
43
|
-
|
|
32
|
+
futurizable: (s) => new l((u, d) => {
|
|
33
|
+
s.then(u).catch(d);
|
|
44
34
|
}, n)
|
|
45
35
|
};
|
|
46
|
-
let
|
|
47
|
-
const
|
|
36
|
+
let f = "pending";
|
|
37
|
+
const j = new Promise((s, u) => {
|
|
48
38
|
if (n.aborted) {
|
|
49
|
-
c(),
|
|
39
|
+
c(), f === "pending" && i && i();
|
|
50
40
|
return;
|
|
51
41
|
} else {
|
|
52
|
-
const
|
|
42
|
+
const d = typeof n.onabort == "function" ? n.onabort : () => {
|
|
53
43
|
};
|
|
54
44
|
n.onabort = () => {
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
}, (
|
|
59
|
-
|
|
60
|
-
},
|
|
45
|
+
d(), c(), f === "pending" && i && i();
|
|
46
|
+
}, t((m) => {
|
|
47
|
+
f = "fulfilled", s(m);
|
|
48
|
+
}, (m) => {
|
|
49
|
+
f = "rejected", u(m);
|
|
50
|
+
}, a);
|
|
61
51
|
}
|
|
62
52
|
});
|
|
63
|
-
super((
|
|
64
|
-
|
|
53
|
+
super((s, u) => {
|
|
54
|
+
j.then((d) => s(d)).catch(u);
|
|
65
55
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.controller = r, this.internalSignal = n, this.idsTimeout = l;
|
|
56
|
+
S(this, "controller");
|
|
57
|
+
S(this, "internalSignal");
|
|
58
|
+
S(this, "idsTimeout");
|
|
59
|
+
this.controller = r, this.internalSignal = n, this.idsTimeout = o;
|
|
71
60
|
}
|
|
72
61
|
static get [Symbol.species]() {
|
|
73
62
|
return this;
|
|
@@ -81,119 +70,120 @@ const s = class extends Promise {
|
|
|
81
70
|
get signal() {
|
|
82
71
|
return this.internalSignal;
|
|
83
72
|
}
|
|
73
|
+
clearTimeout() {
|
|
74
|
+
for (const t of this.idsTimeout)
|
|
75
|
+
clearTimeout(t);
|
|
76
|
+
}
|
|
84
77
|
/**
|
|
85
78
|
* Attaches callbacks for the resolution and/or rejection of the Futurable.
|
|
86
79
|
*/
|
|
87
|
-
then(
|
|
80
|
+
then(t, e) {
|
|
88
81
|
let r, n;
|
|
89
|
-
const
|
|
90
|
-
r = c, n =
|
|
82
|
+
const o = new l((c, i) => {
|
|
83
|
+
r = c, n = i;
|
|
91
84
|
}, this.internalSignal);
|
|
92
|
-
return
|
|
93
|
-
var
|
|
94
|
-
if ((
|
|
95
|
-
|
|
85
|
+
return o.controller = this.controller, super.then((c) => {
|
|
86
|
+
var i;
|
|
87
|
+
if ((i = this.internalSignal) != null && i.aborted) {
|
|
88
|
+
this.clearTimeout();
|
|
96
89
|
return;
|
|
97
90
|
}
|
|
98
91
|
try {
|
|
99
|
-
r(
|
|
100
|
-
} catch (
|
|
101
|
-
n(
|
|
92
|
+
r(t ? t(c) : c);
|
|
93
|
+
} catch (h) {
|
|
94
|
+
n(h);
|
|
102
95
|
}
|
|
103
96
|
}, (c) => {
|
|
104
|
-
var
|
|
105
|
-
if ((
|
|
106
|
-
|
|
97
|
+
var i;
|
|
98
|
+
if ((i = this.internalSignal) != null && i.aborted) {
|
|
99
|
+
this.clearTimeout();
|
|
107
100
|
return;
|
|
108
101
|
}
|
|
109
102
|
try {
|
|
110
|
-
|
|
111
|
-
} catch (
|
|
112
|
-
n(
|
|
103
|
+
e ? r(e(c)) : n(c);
|
|
104
|
+
} catch (h) {
|
|
105
|
+
n(h);
|
|
113
106
|
}
|
|
114
|
-
}),
|
|
107
|
+
}), o;
|
|
115
108
|
}
|
|
116
109
|
/**
|
|
117
110
|
* Attaches a callback for only the rejection of the Futurable.
|
|
118
111
|
*/
|
|
119
|
-
catch(
|
|
120
|
-
return this.then(null,
|
|
112
|
+
catch(t) {
|
|
113
|
+
return this.then(null, t);
|
|
121
114
|
}
|
|
122
115
|
/**
|
|
123
|
-
* Attaches a callback that is invoked when the Futurable is settled (fulfilled or rejected).
|
|
116
|
+
* Attaches a callback that is invoked when the Futurable is settled (fulfilled or rejected).
|
|
117
|
+
* The resolved value cannot be modified from the callback.
|
|
124
118
|
*/
|
|
125
|
-
finally(
|
|
119
|
+
finally(t) {
|
|
126
120
|
return this.then(
|
|
127
|
-
() =>
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
() => {
|
|
131
|
-
e();
|
|
132
|
-
}
|
|
121
|
+
(e) => (t(), e),
|
|
122
|
+
(e) => (t(), e)
|
|
133
123
|
);
|
|
134
124
|
}
|
|
135
125
|
/**
|
|
136
126
|
* Cancel the futurable if it is to be executed or if it is still executing.
|
|
137
127
|
*/
|
|
138
128
|
cancel() {
|
|
139
|
-
var
|
|
140
|
-
!((
|
|
129
|
+
var t, e;
|
|
130
|
+
!((t = this.internalSignal) != null && t.aborted) && ((e = this.controller) == null || e.abort());
|
|
141
131
|
}
|
|
142
132
|
/**
|
|
143
133
|
* Waits for timer, then executes callback with the futurable value and returns the result obtained from the invocation.
|
|
144
134
|
* @param cb: callback executed after timer with futurable chain value as parameter
|
|
145
135
|
* @param timer: timer to wait (in milliseconds)
|
|
146
136
|
*/
|
|
147
|
-
delay(
|
|
137
|
+
delay(t, e) {
|
|
148
138
|
let r, n;
|
|
149
|
-
const
|
|
150
|
-
r = c, n =
|
|
139
|
+
const o = new l((c, i) => {
|
|
140
|
+
r = c, n = i;
|
|
151
141
|
}, this.internalSignal);
|
|
152
|
-
return
|
|
142
|
+
return o.controller = this.controller, this.then(
|
|
153
143
|
(c) => {
|
|
154
|
-
this.idsTimeout.push(setTimeout(() => r(
|
|
144
|
+
this.idsTimeout.push(setTimeout(() => r(t(c)), e));
|
|
155
145
|
},
|
|
156
146
|
(c) => {
|
|
157
147
|
n(c);
|
|
158
148
|
}
|
|
159
|
-
),
|
|
149
|
+
), o;
|
|
160
150
|
}
|
|
161
151
|
/**
|
|
162
152
|
* Waits for timer parameter (in milliseconds) before returning the value.
|
|
163
153
|
* @param timer: timer to wait (in milliseconds)
|
|
164
154
|
*/
|
|
165
|
-
sleep(
|
|
166
|
-
return this.delay((
|
|
155
|
+
sleep(t) {
|
|
156
|
+
return this.delay((e) => e, t);
|
|
167
157
|
}
|
|
168
158
|
/**
|
|
169
159
|
* Extension of the fetch API with cancellation support. Url parameter can be a string or a function with receive value from futurable chaining as paremeter.
|
|
170
160
|
* @param url: url to fetch or function with futurable chaining value that returns url to fetch
|
|
171
161
|
* @param opts: fetch options or function with futurable chaining value that return fetch options
|
|
172
162
|
*/
|
|
173
|
-
fetch(
|
|
163
|
+
fetch(t, e) {
|
|
174
164
|
let r, n;
|
|
175
|
-
const
|
|
176
|
-
r = c, n =
|
|
165
|
+
const o = new l((c, i) => {
|
|
166
|
+
r = c, n = i;
|
|
177
167
|
}, this.internalSignal);
|
|
178
|
-
return
|
|
179
|
-
const
|
|
180
|
-
fetch(
|
|
181
|
-
|
|
168
|
+
return o.controller = this.controller, this.then((c) => {
|
|
169
|
+
const i = typeof t == "function" ? t(c) : t, h = { ...typeof e == "function" ? e(c) : e, signal: this.internalSignal };
|
|
170
|
+
fetch(i, h).then((a) => r(a)).catch((a) => {
|
|
171
|
+
a.name !== "AbortError" && n(a);
|
|
182
172
|
});
|
|
183
|
-
}),
|
|
173
|
+
}), o;
|
|
184
174
|
}
|
|
185
175
|
/**
|
|
186
176
|
* Executes the callback passed as a parameter when the futurable is cancelled.
|
|
187
177
|
* @param cb: callback
|
|
188
178
|
*/
|
|
189
|
-
onCancel(
|
|
190
|
-
let
|
|
191
|
-
const n = new
|
|
192
|
-
|
|
179
|
+
onCancel(t) {
|
|
180
|
+
let e, r;
|
|
181
|
+
const n = new l((o, c, i) => {
|
|
182
|
+
i.onCancel(t), e = o, r = c;
|
|
193
183
|
}, this.internalSignal);
|
|
194
184
|
return n.controller = this.controller, this.then(
|
|
195
|
-
(
|
|
196
|
-
(
|
|
185
|
+
(o) => e(o),
|
|
186
|
+
(o) => r(o)
|
|
197
187
|
), n;
|
|
198
188
|
}
|
|
199
189
|
// promisify<TResult1 = T, TResult2 = never>(): Promise<TResult1 | TResult2> {
|
|
@@ -213,96 +203,127 @@ const s = class extends Promise {
|
|
|
213
203
|
* Takes a promise and transforms it into a futurizable. Promise can be also a function that receives value from futurable chaining as parameter.
|
|
214
204
|
* @param promise: Promise to futurize or function that return promise with futurable chaining value as parameter
|
|
215
205
|
*/
|
|
216
|
-
futurizable(
|
|
217
|
-
let
|
|
218
|
-
const n = new
|
|
219
|
-
|
|
206
|
+
futurizable(t) {
|
|
207
|
+
let e, r;
|
|
208
|
+
const n = new l((o, c) => {
|
|
209
|
+
e = o, r = c;
|
|
220
210
|
}, this.internalSignal);
|
|
221
|
-
return n.controller = this.controller, this.then((
|
|
222
|
-
(typeof
|
|
211
|
+
return n.controller = this.controller, this.then((o) => {
|
|
212
|
+
(typeof t == "function" ? t(o) : t).then(e).catch(r);
|
|
223
213
|
}), n;
|
|
224
214
|
}
|
|
225
|
-
static resolve(
|
|
226
|
-
return new
|
|
215
|
+
static resolve(t, e) {
|
|
216
|
+
return t ? new l((r) => r(t), e) : new l((r) => r(), e);
|
|
227
217
|
}
|
|
228
|
-
static reject(
|
|
229
|
-
return new
|
|
218
|
+
static reject(t, e) {
|
|
219
|
+
return new l((r, n) => n(t), e);
|
|
230
220
|
}
|
|
231
221
|
/**
|
|
232
222
|
* OnCancel static method. It accepts a callback or a object with cb property and an optional signal.
|
|
233
223
|
*/
|
|
234
|
-
static onCancel({ cb:
|
|
235
|
-
return new
|
|
236
|
-
|
|
237
|
-
},
|
|
224
|
+
static onCancel({ cb: t, signal: e }) {
|
|
225
|
+
return new l((r, n, o) => {
|
|
226
|
+
o.onCancel(() => r(t()));
|
|
227
|
+
}, e);
|
|
238
228
|
}
|
|
239
229
|
/**
|
|
240
230
|
* Delay static method. It accepts a object with timer and cb properties and an optional signal property.
|
|
241
231
|
*/
|
|
242
|
-
static delay({ cb:
|
|
243
|
-
return
|
|
232
|
+
static delay({ cb: t, timer: e, signal: r }) {
|
|
233
|
+
return new l((n, o, c) => {
|
|
234
|
+
c.delay(t, e).then(n, o);
|
|
235
|
+
}, r);
|
|
244
236
|
}
|
|
245
237
|
/**
|
|
246
238
|
* Sleep static method. It accepts a timer or a object with timer property and an optional signal.
|
|
247
239
|
*/
|
|
248
|
-
static sleep({ timer:
|
|
249
|
-
return
|
|
240
|
+
static sleep({ timer: t, signal: e }) {
|
|
241
|
+
return l.delay({
|
|
250
242
|
cb: () => {
|
|
251
243
|
},
|
|
252
|
-
timer:
|
|
253
|
-
signal:
|
|
244
|
+
timer: t,
|
|
245
|
+
signal: e
|
|
254
246
|
});
|
|
255
247
|
}
|
|
256
248
|
/**
|
|
257
249
|
* Fetch static method.
|
|
258
250
|
*/
|
|
259
|
-
static fetch(
|
|
260
|
-
const r = (
|
|
261
|
-
return
|
|
251
|
+
static fetch(t, e) {
|
|
252
|
+
const r = (e == null ? void 0 : e.signal) || void 0;
|
|
253
|
+
return e != null && e.signal && delete e.signal, new l((n, o, c) => {
|
|
254
|
+
c.fetch(t, e).then(n);
|
|
255
|
+
}, r);
|
|
262
256
|
}
|
|
263
257
|
/**
|
|
264
258
|
* Futurizable static method.
|
|
265
259
|
*/
|
|
266
|
-
static futurizable({ promise:
|
|
267
|
-
return new
|
|
268
|
-
|
|
269
|
-
},
|
|
260
|
+
static futurizable({ promise: t, signal: e }) {
|
|
261
|
+
return new l((r, n) => {
|
|
262
|
+
t.then(r).catch(n);
|
|
263
|
+
}, e);
|
|
270
264
|
}
|
|
271
|
-
static
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
265
|
+
static handleValues(t, e) {
|
|
266
|
+
const r = [];
|
|
267
|
+
for (const n in t)
|
|
268
|
+
t[n] instanceof l ? r.push(t[n]) : t[n] instanceof Promise ? r.push(
|
|
269
|
+
new l(
|
|
270
|
+
(o, c) => {
|
|
271
|
+
t[n].then((i) => o(i)).catch(c);
|
|
272
|
+
},
|
|
273
|
+
e
|
|
274
|
+
)
|
|
275
|
+
) : r.push(
|
|
276
|
+
new l(
|
|
277
|
+
(o) => o(t[n]),
|
|
278
|
+
e
|
|
279
|
+
)
|
|
280
|
+
);
|
|
281
|
+
return r;
|
|
285
282
|
}
|
|
286
283
|
/**
|
|
287
284
|
* Creates a Futurable with cancellation support that is resolved with an array of results when all of the provided Futurables resolve, or rejected when any Futurable is rejected.
|
|
288
285
|
*/
|
|
289
|
-
static all(
|
|
290
|
-
|
|
291
|
-
|
|
286
|
+
static all(t, e) {
|
|
287
|
+
let r, n;
|
|
288
|
+
const o = new l((i, h, a) => {
|
|
289
|
+
r = i, n = h, a.onCancel(() => {
|
|
290
|
+
for (const f of c)
|
|
291
|
+
f.cancel();
|
|
292
|
+
});
|
|
293
|
+
}, e);
|
|
294
|
+
e || (e = o.internalSignal);
|
|
295
|
+
const c = l.handleValues(t, e);
|
|
296
|
+
return super.all(c).then((i) => r(i)).catch((i) => n(i)), o;
|
|
292
297
|
}
|
|
293
298
|
/**
|
|
294
299
|
* Creates a Futurable with cancellation support that is resolved with an array of results when all of the provided Futurables resolve or reject.
|
|
295
300
|
*/
|
|
296
|
-
static allSettled(
|
|
297
|
-
|
|
298
|
-
|
|
301
|
+
static allSettled(t, e) {
|
|
302
|
+
let r;
|
|
303
|
+
const n = new l((c, i, h) => {
|
|
304
|
+
r = c, h.onCancel(() => {
|
|
305
|
+
for (const a of o)
|
|
306
|
+
a.cancel();
|
|
307
|
+
});
|
|
308
|
+
}, e);
|
|
309
|
+
e || (e = n.internalSignal);
|
|
310
|
+
const o = l.handleValues(t, e);
|
|
311
|
+
return super.allSettled(o).then((c) => r(c)), n;
|
|
299
312
|
}
|
|
300
313
|
/**
|
|
301
314
|
* Creates a Futurable with cancellation support that is resolved or rejected when any of the provided Futurables are resolved or rejected.
|
|
302
315
|
*/
|
|
303
|
-
static race(
|
|
304
|
-
|
|
305
|
-
|
|
316
|
+
static race(t, e) {
|
|
317
|
+
let r, n;
|
|
318
|
+
const o = new l((i, h, a) => {
|
|
319
|
+
r = i, n = h, a.onCancel(() => {
|
|
320
|
+
for (const f of c)
|
|
321
|
+
f.cancel();
|
|
322
|
+
});
|
|
323
|
+
}, e);
|
|
324
|
+
e || (e = o.internalSignal);
|
|
325
|
+
const c = l.handleValues(t, e);
|
|
326
|
+
return super.race(c).then((i) => r(i)).catch((i) => n(i)), o;
|
|
306
327
|
}
|
|
307
328
|
/**
|
|
308
329
|
* The any function returns a futurable with cancellation support that is fulfilled by the first given futurable to be fulfilled,
|
|
@@ -310,17 +331,19 @@ const s = class extends Promise {
|
|
|
310
331
|
* given futurables are rejected. It resolves all elements of the passed iterable to futurables as
|
|
311
332
|
* it runs this algorithm.
|
|
312
333
|
*/
|
|
313
|
-
static any(
|
|
314
|
-
|
|
315
|
-
|
|
334
|
+
static any(t, e) {
|
|
335
|
+
let r, n;
|
|
336
|
+
const o = new l((i, h, a) => {
|
|
337
|
+
r = i, n = h, a.onCancel(() => {
|
|
338
|
+
for (const f of c)
|
|
339
|
+
f.cancel();
|
|
340
|
+
});
|
|
341
|
+
}, e);
|
|
342
|
+
e || (e = o.internalSignal);
|
|
343
|
+
const c = l.handleValues(t, e);
|
|
344
|
+
return super.any(c).then((i) => r(i)).catch((i) => n(i)), o;
|
|
316
345
|
}
|
|
317
|
-
}
|
|
318
|
-
let I = s;
|
|
319
|
-
m = new WeakSet(), v = function() {
|
|
320
|
-
for (const e of this.idsTimeout)
|
|
321
|
-
clearTimeout(e);
|
|
322
|
-
};
|
|
346
|
+
}
|
|
323
347
|
export {
|
|
324
|
-
|
|
325
|
-
I as Futurable
|
|
348
|
+
l as Futurable
|
|
326
349
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export interface FuturableLike<T> {
|
|
2
|
+
/**
|
|
3
|
+
* Attaches callbacks for the resolution and/or rejection of the Futurable.
|
|
4
|
+
* @param onfulfilled The callback to execute when the Futurable is resolved.
|
|
5
|
+
* @param onrejected The callback to execute when the Futurable is rejected.
|
|
6
|
+
* @returns A Futurable for the completion of which ever callback is executed.
|
|
7
|
+
*/
|
|
8
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1> | FuturableLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2> | FuturableLike<TResult2>) | undefined | null): FuturableLike<TResult1 | TResult2>;
|
|
9
|
+
}
|
|
4
10
|
export interface FuturableResolve<T> {
|
|
5
|
-
(value
|
|
11
|
+
(value: T | FuturableLike<T> | PromiseLike<T>): void;
|
|
6
12
|
}
|
|
7
13
|
export interface FuturableReject {
|
|
8
14
|
(reason?: any): void;
|
|
@@ -26,40 +32,31 @@ export interface FuturableUtils<T> {
|
|
|
26
32
|
* @param cb: callback executed after timer
|
|
27
33
|
* @param timer: timer to wait (in milliseconds)
|
|
28
34
|
*/
|
|
29
|
-
delay: (cb: () =>
|
|
35
|
+
delay: <TResult = T, TResult2 = never>(cb: () => TResult, timer: number) => FuturableLike<TResult | TResult2>;
|
|
30
36
|
/**
|
|
31
37
|
* Waits for timer parameter (in milliseconds) before returning the value.
|
|
32
38
|
* @param timer: timer to wait (in milliseconds)
|
|
33
39
|
*/
|
|
34
|
-
sleep: (timer: number) =>
|
|
40
|
+
sleep: (timer: number) => FuturableLike<void>;
|
|
35
41
|
/**
|
|
36
42
|
* Extension of the fetch API with cancellation support. Url parameter can be a string or a function with receive value from futurable chaining as paremeter.
|
|
37
43
|
* @param url: url to fetch
|
|
38
44
|
* @param opts: fetch options
|
|
39
45
|
*/
|
|
40
|
-
fetch: (url: string, opts?: RequestInit) => Futurable<
|
|
46
|
+
fetch: (url: string, opts?: RequestInit) => Futurable<Response>;
|
|
41
47
|
/**
|
|
42
48
|
* Takes a promise and transforms it into a futurizable. Promise can be also a function that receives value from futurable chaining as parameter.
|
|
43
49
|
* @param promise: Promise to futurize
|
|
44
50
|
*/
|
|
45
|
-
futurizable: (promise: Promise<
|
|
51
|
+
futurizable: <TResult = any>(promise: Promise<TResult>) => Futurable<TResult>;
|
|
46
52
|
}
|
|
47
53
|
export type FuturableExecutor<T> = (resolve: FuturableResolve<T>, reject: FuturableReject,
|
|
48
54
|
/**
|
|
49
55
|
* Object containing implemented functionalities.
|
|
50
56
|
*/
|
|
51
57
|
utils: FuturableUtils<T>) => void;
|
|
52
|
-
export type FuturableIterable =
|
|
53
|
-
export interface FuturableLike<T> {
|
|
54
|
-
then<TResult1 = T, TResult2 = never>(onfulfilled?: FuturableOnfulfilled<TResult1, TResult2>, onrejected?: FuturableOnrejected<TResult2>): FuturableLike<TResult1 | TResult2>;
|
|
55
|
-
}
|
|
56
|
-
export declare enum FUTURABLE_STATUS {
|
|
57
|
-
PENDING = "pending",
|
|
58
|
-
FULFILLED = "fulfilled",
|
|
59
|
-
REJECTED = "rejected"
|
|
60
|
-
}
|
|
58
|
+
export type FuturableIterable<T = any> = Iterable<FuturableLike<T> | PromiseLike<T> | T>;
|
|
61
59
|
export declare class Futurable<T> extends Promise<T> {
|
|
62
|
-
#private;
|
|
63
60
|
private controller;
|
|
64
61
|
private internalSignal;
|
|
65
62
|
private idsTimeout;
|
|
@@ -70,18 +67,20 @@ export declare class Futurable<T> extends Promise<T> {
|
|
|
70
67
|
* Return internal futurable signal
|
|
71
68
|
*/
|
|
72
69
|
get signal(): AbortSignal;
|
|
70
|
+
private clearTimeout;
|
|
73
71
|
/**
|
|
74
72
|
* Attaches callbacks for the resolution and/or rejection of the Futurable.
|
|
75
73
|
*/
|
|
76
|
-
then<TResult1 = T, TResult2 = never>(
|
|
74
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1> | FuturableLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2> | FuturableLike<TResult2>) | undefined | null): Futurable<TResult1 | TResult2>;
|
|
77
75
|
/**
|
|
78
76
|
* Attaches a callback for only the rejection of the Futurable.
|
|
79
77
|
*/
|
|
80
|
-
catch<
|
|
78
|
+
catch<TResult2 = never>(onRejected: ((reason: any) => TResult2 | PromiseLike<TResult2> | FuturableLike<TResult2>) | undefined | null): Futurable<T | TResult2>;
|
|
81
79
|
/**
|
|
82
|
-
* Attaches a callback that is invoked when the Futurable is settled (fulfilled or rejected).
|
|
80
|
+
* Attaches a callback that is invoked when the Futurable is settled (fulfilled or rejected).
|
|
81
|
+
* The resolved value cannot be modified from the callback.
|
|
83
82
|
*/
|
|
84
|
-
finally(
|
|
83
|
+
finally(onfinally: () => void | undefined | null): Futurable<T>;
|
|
85
84
|
/**
|
|
86
85
|
* Cancel the futurable if it is to be executed or if it is still executing.
|
|
87
86
|
*/
|
|
@@ -91,56 +90,57 @@ export declare class Futurable<T> extends Promise<T> {
|
|
|
91
90
|
* @param cb: callback executed after timer with futurable chain value as parameter
|
|
92
91
|
* @param timer: timer to wait (in milliseconds)
|
|
93
92
|
*/
|
|
94
|
-
delay<TResult1 = T, TResult2 = never>(cb: (val
|
|
93
|
+
delay<TResult1 = T, TResult2 = never>(cb: (val: T) => TResult1 | PromiseLike<TResult1> | FuturableLike<TResult1>, timer: number): Futurable<TResult1 | TResult2>;
|
|
95
94
|
/**
|
|
96
95
|
* Waits for timer parameter (in milliseconds) before returning the value.
|
|
97
96
|
* @param timer: timer to wait (in milliseconds)
|
|
98
97
|
*/
|
|
99
|
-
sleep
|
|
98
|
+
sleep(timer: number): Futurable<T>;
|
|
100
99
|
/**
|
|
101
100
|
* Extension of the fetch API with cancellation support. Url parameter can be a string or a function with receive value from futurable chaining as paremeter.
|
|
102
101
|
* @param url: url to fetch or function with futurable chaining value that returns url to fetch
|
|
103
102
|
* @param opts: fetch options or function with futurable chaining value that return fetch options
|
|
104
103
|
*/
|
|
105
|
-
fetch
|
|
104
|
+
fetch(url: string | ((val?: T) => string), opts?: object | RequestInit | ((val?: T) => RequestInit)): Futurable<Response>;
|
|
106
105
|
/**
|
|
107
106
|
* Executes the callback passed as a parameter when the futurable is cancelled.
|
|
108
107
|
* @param cb: callback
|
|
109
108
|
*/
|
|
110
|
-
onCancel<TResult1 =
|
|
109
|
+
onCancel<TResult1 = void, TResult2 = never>(cb: () => void): Futurable<TResult1 | TResult2>;
|
|
111
110
|
/**
|
|
112
111
|
* Takes a promise and transforms it into a futurizable. Promise can be also a function that receives value from futurable chaining as parameter.
|
|
113
112
|
* @param promise: Promise to futurize or function that return promise with futurable chaining value as parameter
|
|
114
113
|
*/
|
|
115
|
-
futurizable<TResult1 = T, TResult2 = never>(promise: Promise<TResult1> | ((val?:
|
|
116
|
-
static resolve(
|
|
117
|
-
static
|
|
114
|
+
futurizable<TResult1 = T, TResult2 = never>(promise: Promise<TResult1> | ((val?: T) => Promise<TResult1>)): Futurable<TResult1 | TResult2>;
|
|
115
|
+
static resolve(): Futurable<void>;
|
|
116
|
+
static resolve<T = any>(value: T | PromiseLike<T> | FuturableLike<T>, signal?: AbortSignal): Futurable<T>;
|
|
117
|
+
static reject<T = never>(reason?: any, signal?: AbortSignal): Futurable<T>;
|
|
118
118
|
/**
|
|
119
119
|
* OnCancel static method. It accepts a callback or a object with cb property and an optional signal.
|
|
120
120
|
*/
|
|
121
|
-
static onCancel({ cb, signal }: {
|
|
122
|
-
cb: () =>
|
|
121
|
+
static onCancel<T = void>({ cb, signal }: {
|
|
122
|
+
cb: () => T;
|
|
123
123
|
signal?: AbortSignal;
|
|
124
|
-
}): Futurable<
|
|
124
|
+
}): Futurable<T>;
|
|
125
125
|
/**
|
|
126
126
|
* Delay static method. It accepts a object with timer and cb properties and an optional signal property.
|
|
127
127
|
*/
|
|
128
|
-
static delay({ cb, timer, signal }: {
|
|
128
|
+
static delay<T = any, TResult2 = never>({ cb, timer, signal }: {
|
|
129
129
|
cb: () => any;
|
|
130
130
|
timer: number;
|
|
131
131
|
signal?: AbortSignal;
|
|
132
|
-
}): Futurable<
|
|
132
|
+
}): Futurable<T | TResult2>;
|
|
133
133
|
/**
|
|
134
134
|
* Sleep static method. It accepts a timer or a object with timer property and an optional signal.
|
|
135
135
|
*/
|
|
136
136
|
static sleep({ timer, signal }: {
|
|
137
137
|
timer: number;
|
|
138
138
|
signal?: AbortSignal;
|
|
139
|
-
}): Futurable<
|
|
139
|
+
}): Futurable<void>;
|
|
140
140
|
/**
|
|
141
141
|
* Fetch static method.
|
|
142
142
|
*/
|
|
143
|
-
static fetch(url: string, opts?: RequestInit): Futurable<
|
|
143
|
+
static fetch(url: string, opts?: RequestInit): Futurable<Response>;
|
|
144
144
|
/**
|
|
145
145
|
* Futurizable static method.
|
|
146
146
|
*/
|
|
@@ -148,25 +148,29 @@ export declare class Futurable<T> extends Promise<T> {
|
|
|
148
148
|
promise: Promise<TResult1>;
|
|
149
149
|
signal?: AbortSignal;
|
|
150
150
|
}): Futurable<TResult1 | TResult2>;
|
|
151
|
-
private static
|
|
151
|
+
private static handleValues;
|
|
152
152
|
/**
|
|
153
153
|
* Creates a Futurable with cancellation support that is resolved with an array of results when all of the provided Futurables resolve, or rejected when any Futurable is rejected.
|
|
154
154
|
*/
|
|
155
|
-
static all(
|
|
155
|
+
static all<T extends readonly unknown[] | []>(values: T, signal?: AbortSignal): Futurable<{
|
|
156
|
+
-readonly [P in keyof T]: Awaited<T[P]>;
|
|
157
|
+
}>;
|
|
156
158
|
/**
|
|
157
159
|
* Creates a Futurable with cancellation support that is resolved with an array of results when all of the provided Futurables resolve or reject.
|
|
158
160
|
*/
|
|
159
|
-
static allSettled(
|
|
161
|
+
static allSettled<T extends readonly unknown[] | []>(values: T, signal?: AbortSignal): Futurable<{
|
|
162
|
+
-readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>;
|
|
163
|
+
}>;
|
|
160
164
|
/**
|
|
161
165
|
* Creates a Futurable with cancellation support that is resolved or rejected when any of the provided Futurables are resolved or rejected.
|
|
162
166
|
*/
|
|
163
|
-
static race(
|
|
167
|
+
static race<T extends readonly unknown[] | []>(values: T, signal?: AbortSignal): Futurable<Awaited<T[number]>>;
|
|
164
168
|
/**
|
|
165
169
|
* The any function returns a futurable with cancellation support that is fulfilled by the first given futurable to be fulfilled,
|
|
166
170
|
* or rejected with an AggregateError containing an array of rejection reasons if all of the
|
|
167
171
|
* given futurables are rejected. It resolves all elements of the passed iterable to futurables as
|
|
168
172
|
* it runs this algorithm.
|
|
169
173
|
*/
|
|
170
|
-
static any(
|
|
174
|
+
static any<T extends readonly unknown[] | []>(value: T, signal?: AbortSignal): Futurable<Awaited<T[number]>>;
|
|
171
175
|
}
|
|
172
176
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B;;;;;OAKG;IACH,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EAClC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EAC3G,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAC3G,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;CACtC;AACD,MAAM,WAAW,gBAAgB,CAAC,CAA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