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