@ndriadev/futurable 2.1.1 → 2.1.2

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 CHANGED
@@ -41,6 +41,7 @@
41
41
  - [Futurable.any](#futurableanyvalues-t-signal-abortsignal)
42
42
  - [Futurable.race](#futurableracevalues-t-signal-abortsignal)
43
43
  - [Futurable.polling](#futurablepollingvalue--futurable--interval-signal-interval-number-signal-abortsignal)
44
+ - [Futurable.builder](#futurablebuildersignal-abortsignal)
44
45
  - [ToDo](#TODO)
45
46
  - [License](#License)
46
47
 
@@ -136,6 +137,7 @@ They are the following:
136
137
  - [Futurable.any](#futurableanyvalues-t-signal-abortsignal)
137
138
  - [Futurable.race](#futurableracevalues-t-signal-abortsignal)
138
139
  - [Futurable.polling](#futurablepollingvalue--futurable--interval-signal-interval-number-signal-abortsignal)
140
+ - [Futurable.builder](#futurablebuildersignal-abortsignal)
139
141
 
140
142
  ### constructor(executor: FuturableExecutor<T>, signal?: AbortSignal)
141
143
  Futurable is instantiable like a classic Promise.
@@ -603,8 +605,27 @@ polling.catch(err => console.error(err));
603
605
  polling.cancel();
604
606
  ```
605
607
 
608
+ ### Futurable.builder<T>(signal?: AbortSignal)
609
+ Creates an object with:
610
+ - _build_: function to create a Futurable.
611
+ - _resolve_: function to resolve the Futurable created.
612
+ - _reject_: function to reject the Futurable created.
613
+ - _utils_: object that reflects __utils__ object of Futurabled created.
614
+
615
+ *Example*
616
+ ```javascript
617
+ //...code
618
+ const future = Futurable.buider();
619
+
620
+ //...code
621
+
622
+ await future.build();
623
+
624
+ //...code
625
+ future.resolve("resolved");
626
+ ```
627
+
606
628
  # ToDo
607
- - Think about the possibility of making a static method that returns an object with the futurable, resolve, reject, utils properties inside to be used as done for usePromiser.
608
629
  - Extends fetch api support to third library like axios.
609
630
  - Implement promise cache.
610
631
 
@@ -1 +1 @@
1
- "use strict";var T=Object.defineProperty;var C=(w,g,t)=>g in w?T(w,g,{enumerable:!0,configurable:!0,writable:!0,value:t}):w[g]=t;var S=(w,g,t)=>(C(w,typeof g!="symbol"?g+"":g,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i extends Promise{constructor(t,e){const r=e?null:new AbortController,n=e||r.signal,o=[],c=()=>{for(const a of o)clearTimeout(a)};let l;const h={signal:n,cancel:()=>{var a;return(a=this.controller)==null?void 0:a.abort()},onCancel:a=>{l=a},delay:(a,u)=>new i(d=>{o.push(setTimeout(()=>{d(a())},u))},n),sleep:a=>h.delay(()=>{},a),fetch:(a,u)=>new i((d,p)=>{fetch(a,{...u||{},signal:n}).then(y=>d(y)).catch(y=>{y.name!=="AbortError"&&p(y)})},n),futurizable:a=>new i((u,d)=>{a.then(u).catch(d)},n)};let f="pending";const m=new Promise((a,u)=>{if(n.aborted){c(),f==="pending"&&l&&l();return}else{const d=typeof n.onabort=="function"?n.onabort:()=>{};n.onabort=()=>{d(),c(),f==="pending"&&l&&l()},t(j=>{f="fulfilled",a(j)},j=>{f="rejected",u(j)},h)}});super((a,u)=>{m.then(d=>a(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 i((c,l)=>{r=c,n=l},this.internalSignal);return o.controller=this.controller,super.then(c=>{var l;if((l=this.internalSignal)!=null&&l.aborted){this.clearTimeout();return}try{r(t?t(c):c)}catch(s){n(s)}},c=>{var l;if((l=this.internalSignal)!=null&&l.aborted){this.clearTimeout();return}try{e?r(e(c)):n(c)}catch(s){n(s)}}),o}catch(t){return this.then(null,t)}finally(t){return this.then(e=>(t(),e),e=>{if(t(),e instanceof Error)throw e;return 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 i((c,l)=>{r=c,n=l},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 i((c,l)=>{r=c,n=l},this.internalSignal);return o.controller=this.controller,this.then(c=>{const l=typeof t=="function"?t(c):t,s={...typeof e=="function"?e(c):e,signal:this.internalSignal};fetch(l,s).then(h=>r(h)).catch(h=>{h.name!=="AbortError"&&n(h)})}),o}onCancel(t){let e,r;const n=new i((o,c,l)=>{l.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 i((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 i(r=>r(t),e):new i(r=>r(),e)}static reject(t,e){return new i((r,n)=>n(t),e)}static onCancel({cb:t,signal:e}){return new i((r,n,o)=>{o.onCancel(()=>r(t()))},e)}static delay({cb:t,timer:e,signal:r}){return new i((n,o,c)=>{c.delay(t,e).then(n,o)},r)}static sleep({timer:t,signal:e}){return i.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 i((n,o,c)=>{c.fetch(t,e).then(n)},r)}static futurizable({promise:t,signal:e}){return new i((r,n)=>{t.then(r).catch(n)},e)}static handleValues(t,e){const r=[];for(const n in t)t[n]instanceof i?r.push(t[n]):t[n]instanceof Promise?r.push(new i((o,c)=>{t[n].then(l=>o(l)).catch(c)},e)):r.push(new i(o=>o(t[n]),e));return r}static all(t,e){let r,n;const o=new i((l,s,h)=>{r=l,n=s,h.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=o.internalSignal);const c=i.handleValues(t,e);return super.all(c).then(l=>r(l)).catch(l=>n(l)),o}static allSettled(t,e){let r;const n=new i((c,l,s)=>{r=c,s.onCancel(()=>{for(const h of o)h.cancel()})},e);e||(e=n.internalSignal);const o=i.handleValues(t,e);return super.allSettled(o).then(c=>r(c)),n}static race(t,e){let r,n;const o=new i((l,s,h)=>{r=l,n=s,h.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=o.internalSignal);const c=i.handleValues(t,e);return super.race(c).then(l=>r(l)).catch(l=>n(l)),o}static any(t,e){let r,n;const o=new i((l,s,h)=>{r=l,n=s,h.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=o.internalSignal);const c=i.handleValues(t,e);return super.any(c).then(l=>r(l)).catch(l=>n(l)),o}static polling(t,{interval:e,signal:r}){let n,o,c;const l=setInterval(()=>{n&&n.cancel(),n=new i((s,h,f)=>{f.onCancel(()=>{o&&o.cancel()}),o=t().then(()=>s()).catch(m=>c&&c(m))},r)},e);return{cancel:()=>{l&&clearInterval(l),n&&n.cancel()},catch:s=>{c=s}}}}exports.Futurable=i;
1
+ "use strict";var T=Object.defineProperty;var C=(w,g,t)=>g in w?T(w,g,{enumerable:!0,configurable:!0,writable:!0,value:t}):w[g]=t;var S=(w,g,t)=>(C(w,typeof g!="symbol"?g+"":g,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i extends Promise{constructor(t,e){const r=e?null:new AbortController,n=e||r.signal,l=[],c=()=>{for(const a of l)clearTimeout(a)};let o;const h={signal:n,cancel:()=>{var a;return(a=this.controller)==null?void 0:a.abort()},onCancel:a=>{o=a},delay:(a,u)=>new i(d=>{l.push(setTimeout(()=>{d(a())},u))},n),sleep:a=>h.delay(()=>{},a),fetch:(a,u)=>new i((d,p)=>{fetch(a,{...u||{},signal:n}).then(y=>d(y)).catch(y=>{y.name!=="AbortError"&&p(y)})},n),futurizable:a=>new i((u,d)=>{a.then(u).catch(d)},n)};let f="pending";const m=new Promise((a,u)=>{if(n.aborted){c(),f==="pending"&&o&&o();return}else{const d=typeof n.onabort=="function"?n.onabort:()=>{};n.onabort=()=>{d(),c(),f==="pending"&&o&&o()},t(j=>{f="fulfilled",a(j)},j=>{f="rejected",u(j)},h)}});super((a,u)=>{m.then(d=>a(d)).catch(u)});S(this,"controller");S(this,"internalSignal");S(this,"idsTimeout");this.controller=r,this.internalSignal=n,this.idsTimeout=l}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 l=new i((c,o)=>{r=c,n=o},this.internalSignal);return l.controller=this.controller,super.then(c=>{var o;if((o=this.internalSignal)!=null&&o.aborted){this.clearTimeout();return}try{r(t?t(c):c)}catch(s){n(s)}},c=>{var o;if((o=this.internalSignal)!=null&&o.aborted){this.clearTimeout();return}try{e?r(e(c)):n(c)}catch(s){n(s)}}),l}catch(t){return this.then(null,t)}finally(t){return this.then(e=>(t(),e),e=>{if(t(),e instanceof Error)throw e;return e})}cancel(){var t,e;!((t=this.internalSignal)!=null&&t.aborted)&&((e=this.controller)==null||e.abort())}delay(t,e){let r,n;const l=new i((c,o)=>{r=c,n=o},this.internalSignal);return l.controller=this.controller,this.then(c=>{this.idsTimeout.push(setTimeout(()=>r(t(c)),e))},c=>{n(c)}),l}sleep(t){return this.delay(e=>e,t)}fetch(t,e){let r,n;const l=new i((c,o)=>{r=c,n=o},this.internalSignal);return l.controller=this.controller,this.then(c=>{const o=typeof t=="function"?t(c):t,s={...typeof e=="function"?e(c):e,signal:this.internalSignal};fetch(o,s).then(h=>r(h)).catch(h=>{h.name!=="AbortError"&&n(h)})}),l}onCancel(t){let e,r;const n=new i((l,c,o)=>{o.onCancel(t),e=l,r=c},this.internalSignal);return n.controller=this.controller,this.then(l=>e(l),l=>r(l)),n}futurizable(t){let e,r;const n=new i((l,c)=>{e=l,r=c},this.internalSignal);return n.controller=this.controller,this.then(l=>{(typeof t=="function"?t(l):t).then(e).catch(r)}),n}static resolve(t,e){return t?new i(r=>r(t),e):new i(r=>r(),e)}static reject(t,e){return new i((r,n)=>n(t),e)}static onCancel({cb:t,signal:e}){return new i((r,n,l)=>{l.onCancel(()=>r(t()))},e)}static delay({cb:t,timer:e,signal:r}){return new i((n,l,c)=>{c.delay(t,e).then(n,l)},r)}static sleep({timer:t,signal:e}){return i.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 i((n,l,c)=>{c.fetch(t,e).then(n)},r)}static futurizable({promise:t,signal:e}){return new i((r,n)=>{t.then(r).catch(n)},e)}static handleValues(t,e){const r=[];for(const n in t)t[n]instanceof i?r.push(t[n]):t[n]instanceof Promise?r.push(new i((l,c)=>{t[n].then(o=>l(o)).catch(c)},e)):r.push(new i(l=>l(t[n]),e));return r}static all(t,e){let r,n;const l=new i((o,s,h)=>{r=o,n=s,h.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=l.internalSignal);const c=i.handleValues(t,e);return super.all(c).then(o=>r(o)).catch(o=>n(o)),l}static allSettled(t,e){let r;const n=new i((c,o,s)=>{r=c,s.onCancel(()=>{for(const h of l)h.cancel()})},e);e||(e=n.internalSignal);const l=i.handleValues(t,e);return super.allSettled(l).then(c=>r(c)),n}static race(t,e){let r,n;const l=new i((o,s,h)=>{r=o,n=s,h.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=l.internalSignal);const c=i.handleValues(t,e);return super.race(c).then(o=>r(o)).catch(o=>n(o)),l}static any(t,e){let r,n;const l=new i((o,s,h)=>{r=o,n=s,h.onCancel(()=>{for(const f of c)f.cancel()})},e);e||(e=l.internalSignal);const c=i.handleValues(t,e);return super.any(c).then(o=>r(o)).catch(o=>n(o)),l}static polling(t,{interval:e,signal:r}){let n,l,c;const o=setInterval(()=>{n&&n.cancel(),n=new i((s,h,f)=>{f.onCancel(()=>{l&&l.cancel()}),l=t().then(()=>s()).catch(m=>c&&c(m))},r)},e);return{cancel:()=>{o&&clearInterval(o),n&&n.cancel()},catch:s=>{c=s}}}static builder(t){return{resolve:null,reject:null,utils:null,build(){return new i((e,r,n)=>{this.resolve=e,this.reject=r,this.utils=n},t)}}}}exports.Futurable=i;
@@ -3,11 +3,11 @@ var C = (g, w, t) => w in g ? T(g, w, { enumerable: !0, configurable: !0, writab
3
3
  var S = (g, w, t) => (C(g, typeof w != "symbol" ? w + "" : w, t), t);
4
4
  class i extends Promise {
5
5
  constructor(t, e) {
6
- const r = e ? null : new AbortController(), n = e || r.signal, o = [], c = () => {
7
- for (const a of o)
6
+ const r = e ? null : new AbortController(), n = e || r.signal, l = [], c = () => {
7
+ for (const a of l)
8
8
  clearTimeout(a);
9
9
  };
10
- let l;
10
+ let o;
11
11
  const h = {
12
12
  signal: n,
13
13
  cancel: () => {
@@ -15,18 +15,18 @@ class i extends Promise {
15
15
  return (a = this.controller) == null ? void 0 : a.abort();
16
16
  },
17
17
  onCancel: (a) => {
18
- l = a;
18
+ o = a;
19
19
  },
20
20
  delay: (a, u) => new i((d) => {
21
- o.push(setTimeout(() => {
21
+ l.push(setTimeout(() => {
22
22
  d(a());
23
23
  }, u));
24
24
  }, n),
25
25
  sleep: (a) => h.delay(() => {
26
26
  }, a),
27
- fetch: (a, u) => new i((d, j) => {
27
+ fetch: (a, u) => new i((d, p) => {
28
28
  fetch(a, { ...u || {}, signal: n }).then((y) => d(y)).catch((y) => {
29
- y.name !== "AbortError" && j(y);
29
+ y.name !== "AbortError" && p(y);
30
30
  });
31
31
  }, n),
32
32
  futurizable: (a) => new i((u, d) => {
@@ -36,17 +36,17 @@ class i extends Promise {
36
36
  let f = "pending";
37
37
  const m = new Promise((a, u) => {
38
38
  if (n.aborted) {
39
- c(), f === "pending" && l && l();
39
+ c(), f === "pending" && o && o();
40
40
  return;
41
41
  } else {
42
42
  const d = typeof n.onabort == "function" ? n.onabort : () => {
43
43
  };
44
44
  n.onabort = () => {
45
- d(), c(), f === "pending" && l && l();
46
- }, t((p) => {
47
- f = "fulfilled", a(p);
48
- }, (p) => {
49
- f = "rejected", u(p);
45
+ d(), c(), f === "pending" && o && o();
46
+ }, t((j) => {
47
+ f = "fulfilled", a(j);
48
+ }, (j) => {
49
+ f = "rejected", u(j);
50
50
  }, h);
51
51
  }
52
52
  });
@@ -56,7 +56,7 @@ class i extends Promise {
56
56
  S(this, "controller");
57
57
  S(this, "internalSignal");
58
58
  S(this, "idsTimeout");
59
- this.controller = r, this.internalSignal = n, this.idsTimeout = o;
59
+ this.controller = r, this.internalSignal = n, this.idsTimeout = l;
60
60
  }
61
61
  static get [Symbol.species]() {
62
62
  return this;
@@ -79,12 +79,12 @@ class i extends Promise {
79
79
  */
80
80
  then(t, e) {
81
81
  let r, n;
82
- const o = new i((c, l) => {
83
- r = c, n = l;
82
+ const l = new i((c, o) => {
83
+ r = c, n = o;
84
84
  }, this.internalSignal);
85
- return o.controller = this.controller, super.then((c) => {
86
- var l;
87
- if ((l = this.internalSignal) != null && l.aborted) {
85
+ return l.controller = this.controller, super.then((c) => {
86
+ var o;
87
+ if ((o = this.internalSignal) != null && o.aborted) {
88
88
  this.clearTimeout();
89
89
  return;
90
90
  }
@@ -94,8 +94,8 @@ class i extends Promise {
94
94
  n(s);
95
95
  }
96
96
  }, (c) => {
97
- var l;
98
- if ((l = this.internalSignal) != null && l.aborted) {
97
+ var o;
98
+ if ((o = this.internalSignal) != null && o.aborted) {
99
99
  this.clearTimeout();
100
100
  return;
101
101
  }
@@ -104,7 +104,7 @@ class i extends Promise {
104
104
  } catch (s) {
105
105
  n(s);
106
106
  }
107
- }), o;
107
+ }), l;
108
108
  }
109
109
  /**
110
110
  * Attaches a callback for only the rejection of the Futurable.
@@ -140,17 +140,17 @@ class i extends Promise {
140
140
  */
141
141
  delay(t, e) {
142
142
  let r, n;
143
- const o = new i((c, l) => {
144
- r = c, n = l;
143
+ const l = new i((c, o) => {
144
+ r = c, n = o;
145
145
  }, this.internalSignal);
146
- return o.controller = this.controller, this.then(
146
+ return l.controller = this.controller, this.then(
147
147
  (c) => {
148
148
  this.idsTimeout.push(setTimeout(() => r(t(c)), e));
149
149
  },
150
150
  (c) => {
151
151
  n(c);
152
152
  }
153
- ), o;
153
+ ), l;
154
154
  }
155
155
  /**
156
156
  * Waits for timer parameter (in milliseconds) before returning the value.
@@ -166,15 +166,15 @@ class i extends Promise {
166
166
  */
167
167
  fetch(t, e) {
168
168
  let r, n;
169
- const o = new i((c, l) => {
170
- r = c, n = l;
169
+ const l = new i((c, o) => {
170
+ r = c, n = o;
171
171
  }, this.internalSignal);
172
- return o.controller = this.controller, this.then((c) => {
173
- const l = typeof t == "function" ? t(c) : t, s = { ...typeof e == "function" ? e(c) : e, signal: this.internalSignal };
174
- fetch(l, s).then((h) => r(h)).catch((h) => {
172
+ return l.controller = this.controller, this.then((c) => {
173
+ const o = typeof t == "function" ? t(c) : t, s = { ...typeof e == "function" ? e(c) : e, signal: this.internalSignal };
174
+ fetch(o, s).then((h) => r(h)).catch((h) => {
175
175
  h.name !== "AbortError" && n(h);
176
176
  });
177
- }), o;
177
+ }), l;
178
178
  }
179
179
  /**
180
180
  * Executes the callback passed as a parameter when the futurable is cancelled.
@@ -182,12 +182,12 @@ class i extends Promise {
182
182
  */
183
183
  onCancel(t) {
184
184
  let e, r;
185
- const n = new i((o, c, l) => {
186
- l.onCancel(t), e = o, r = c;
185
+ const n = new i((l, c, o) => {
186
+ o.onCancel(t), e = l, r = c;
187
187
  }, this.internalSignal);
188
188
  return n.controller = this.controller, this.then(
189
- (o) => e(o),
190
- (o) => r(o)
189
+ (l) => e(l),
190
+ (l) => r(l)
191
191
  ), n;
192
192
  }
193
193
  // promisify<TResult1 = T, TResult2 = never>(): Promise<TResult1 | TResult2> {
@@ -209,11 +209,11 @@ class i extends Promise {
209
209
  */
210
210
  futurizable(t) {
211
211
  let e, r;
212
- const n = new i((o, c) => {
213
- e = o, r = c;
212
+ const n = new i((l, c) => {
213
+ e = l, r = c;
214
214
  }, this.internalSignal);
215
- return n.controller = this.controller, this.then((o) => {
216
- (typeof t == "function" ? t(o) : t).then(e).catch(r);
215
+ return n.controller = this.controller, this.then((l) => {
216
+ (typeof t == "function" ? t(l) : t).then(e).catch(r);
217
217
  }), n;
218
218
  }
219
219
  static resolve(t, e) {
@@ -226,16 +226,16 @@ class i extends Promise {
226
226
  * OnCancel static method. It accepts a callback or a object with cb property and an optional signal.
227
227
  */
228
228
  static onCancel({ cb: t, signal: e }) {
229
- return new i((r, n, o) => {
230
- o.onCancel(() => r(t()));
229
+ return new i((r, n, l) => {
230
+ l.onCancel(() => r(t()));
231
231
  }, e);
232
232
  }
233
233
  /**
234
234
  * Delay static method. It accepts a object with timer and cb properties and an optional signal property.
235
235
  */
236
236
  static delay({ cb: t, timer: e, signal: r }) {
237
- return new i((n, o, c) => {
238
- c.delay(t, e).then(n, o);
237
+ return new i((n, l, c) => {
238
+ c.delay(t, e).then(n, l);
239
239
  }, r);
240
240
  }
241
241
  /**
@@ -254,7 +254,7 @@ class i extends Promise {
254
254
  */
255
255
  static fetch(t, e) {
256
256
  const r = (e == null ? void 0 : e.signal) || void 0;
257
- return e != null && e.signal && delete e.signal, new i((n, o, c) => {
257
+ return e != null && e.signal && delete e.signal, new i((n, l, c) => {
258
258
  c.fetch(t, e).then(n);
259
259
  }, r);
260
260
  }
@@ -271,14 +271,14 @@ class i extends Promise {
271
271
  for (const n in t)
272
272
  t[n] instanceof i ? r.push(t[n]) : t[n] instanceof Promise ? r.push(
273
273
  new i(
274
- (o, c) => {
275
- t[n].then((l) => o(l)).catch(c);
274
+ (l, c) => {
275
+ t[n].then((o) => l(o)).catch(c);
276
276
  },
277
277
  e
278
278
  )
279
279
  ) : r.push(
280
280
  new i(
281
- (o) => o(t[n]),
281
+ (l) => l(t[n]),
282
282
  e
283
283
  )
284
284
  );
@@ -289,45 +289,45 @@ class i extends Promise {
289
289
  */
290
290
  static all(t, e) {
291
291
  let r, n;
292
- const o = new i((l, s, h) => {
293
- r = l, n = s, h.onCancel(() => {
292
+ const l = new i((o, s, h) => {
293
+ r = o, n = s, h.onCancel(() => {
294
294
  for (const f of c)
295
295
  f.cancel();
296
296
  });
297
297
  }, e);
298
- e || (e = o.internalSignal);
298
+ e || (e = l.internalSignal);
299
299
  const c = i.handleValues(t, e);
300
- return super.all(c).then((l) => r(l)).catch((l) => n(l)), o;
300
+ return super.all(c).then((o) => r(o)).catch((o) => n(o)), l;
301
301
  }
302
302
  /**
303
303
  * Creates a Futurable with cancellation support that is resolved with an array of results when all of the provided Futurables resolve or reject.
304
304
  */
305
305
  static allSettled(t, e) {
306
306
  let r;
307
- const n = new i((c, l, s) => {
307
+ const n = new i((c, o, s) => {
308
308
  r = c, s.onCancel(() => {
309
- for (const h of o)
309
+ for (const h of l)
310
310
  h.cancel();
311
311
  });
312
312
  }, e);
313
313
  e || (e = n.internalSignal);
314
- const o = i.handleValues(t, e);
315
- return super.allSettled(o).then((c) => r(c)), n;
314
+ const l = i.handleValues(t, e);
315
+ return super.allSettled(l).then((c) => r(c)), n;
316
316
  }
317
317
  /**
318
318
  * Creates a Futurable with cancellation support that is resolved or rejected when any of the provided Futurables are resolved or rejected.
319
319
  */
320
320
  static race(t, e) {
321
321
  let r, n;
322
- const o = new i((l, s, h) => {
323
- r = l, n = s, h.onCancel(() => {
322
+ const l = new i((o, s, h) => {
323
+ r = o, n = s, h.onCancel(() => {
324
324
  for (const f of c)
325
325
  f.cancel();
326
326
  });
327
327
  }, e);
328
- e || (e = o.internalSignal);
328
+ e || (e = l.internalSignal);
329
329
  const c = i.handleValues(t, e);
330
- return super.race(c).then((l) => r(l)).catch((l) => n(l)), o;
330
+ return super.race(c).then((o) => r(o)).catch((o) => n(o)), l;
331
331
  }
332
332
  /**
333
333
  * The any function returns a futurable with cancellation support that is fulfilled by the first given futurable to be fulfilled,
@@ -337,37 +337,56 @@ class i extends Promise {
337
337
  */
338
338
  static any(t, e) {
339
339
  let r, n;
340
- const o = new i((l, s, h) => {
341
- r = l, n = s, h.onCancel(() => {
340
+ const l = new i((o, s, h) => {
341
+ r = o, n = s, h.onCancel(() => {
342
342
  for (const f of c)
343
343
  f.cancel();
344
344
  });
345
345
  }, e);
346
- e || (e = o.internalSignal);
346
+ e || (e = l.internalSignal);
347
347
  const c = i.handleValues(t, e);
348
- return super.any(c).then((l) => r(l)).catch((l) => n(l)), o;
348
+ return super.any(c).then((o) => r(o)).catch((o) => n(o)), l;
349
349
  }
350
350
  /**
351
351
  * Creates a polling service with cancellation support and possibility to handle error.
352
352
  */
353
353
  static polling(t, { interval: e, signal: r }) {
354
- let n, o, c;
355
- const l = setInterval(() => {
354
+ let n, l, c;
355
+ const o = setInterval(() => {
356
356
  n && n.cancel(), n = new i((s, h, f) => {
357
357
  f.onCancel(() => {
358
- o && o.cancel();
359
- }), o = t().then(() => s()).catch((m) => c && c(m));
358
+ l && l.cancel();
359
+ }), l = t().then(() => s()).catch((m) => c && c(m));
360
360
  }, r);
361
361
  }, e);
362
362
  return {
363
363
  cancel: () => {
364
- l && clearInterval(l), n && n.cancel();
364
+ o && clearInterval(o), n && n.cancel();
365
365
  },
366
366
  catch: (s) => {
367
367
  c = s;
368
368
  }
369
369
  };
370
370
  }
371
+ /**
372
+ * Creates an object with:
373
+ * - _build_: function to create a Futurable.
374
+ * - _resolve_: function to resolve the Futurable created.
375
+ * - _reject_: function to reject the Futurable created.
376
+ * - _utils_: object that reflects __utils__ object of Futurabled created.
377
+ */
378
+ static builder(t) {
379
+ return {
380
+ resolve: null,
381
+ reject: null,
382
+ utils: null,
383
+ build() {
384
+ return new i((e, r, n) => {
385
+ this.resolve = e, this.reject = r, this.utils = n;
386
+ }, t);
387
+ }
388
+ };
389
+ }
371
390
  }
372
391
  export {
373
392
  i as Futurable
package/dist/index.d.ts CHANGED
@@ -182,5 +182,18 @@ export declare class Futurable<T> extends Promise<T> {
182
182
  cancel: () => void;
183
183
  catch: (onrejected: (reason: unknown) => void) => void;
184
184
  };
185
+ /**
186
+ * Creates an object with:
187
+ * - _build_: function to create a Futurable.
188
+ * - _resolve_: function to resolve the Futurable created.
189
+ * - _reject_: function to reject the Futurable created.
190
+ * - _utils_: object that reflects __utils__ object of Futurabled created.
191
+ */
192
+ static builder<T>(signal?: AbortSignal): {
193
+ resolve: null | FuturableResolve<T>;
194
+ reject: null | FuturableReject;
195
+ utils: null | FuturableUtils<T>;
196
+ build: () => Futurable<T>;
197
+ };
185
198
  }
186
199
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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;IAChC;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;;OAGG;IACH,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IACnC;;;;OAI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G,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAmB7G;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,MAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAC,GAAG;QAAC,MAAM,EAAE,MAAM,IAAI,CAAC;QAAC,KAAK,EAAE,CAAC,UAAU,EAAC,CAAC,MAAM,EAAE,OAAO,KAAG,IAAI,KAAG,IAAI,CAAA;KAAE;IAsBpL;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG;QAAE,OAAO,EAAE,IAAI,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAAC,MAAM,EAAE,IAAI,GAAG,eAAe,CAAC;QAAC,KAAK,EAAE,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,CAAA;KAAC;CAc3K"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ndriadev/futurable",
3
3
  "description": "Extension Javascript's Promise API with more functionalities",
4
4
  "private": false,
5
- "version": "2.1.1",
5
+ "version": "2.1.2",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist/",