CanceledError
8 | CanceledError class
9 |
10 | **Kind**: static property of [CPromise
](#module_CPromise)
11 |
12 |
13 | ### CPromise.AbortController : AbortController
\| AbortControllerEx
14 | Refers to the AbortController class (native if available)
15 |
16 | **Kind**: static property of [CPromise
](#module_CPromise)
17 |
18 |
19 | ### CPromise.AbortControllerEx : AbortControllerEx
20 | AbortControllerEx class
21 |
22 | **Kind**: static property of [CPromise
](#module_CPromise)
23 |
24 |
25 | ### CPromise.E\_REASON\_CANCELED
26 | Generic cancellation reason
27 |
28 | **Kind**: static property of [CPromise
](#module_CPromise)
29 |
30 |
31 | ### CPromise.E\_REASON\_DISPOSED
32 | Cancellation reason for the case when the instance will be disposed
33 |
34 | **Kind**: static property of [CPromise
](#module_CPromise)
35 |
36 |
37 | ### CPromise.E\_REASON\_TIMEOUT
38 | Timeout cancellation reason
39 |
40 | **Kind**: static property of [CPromise
](#module_CPromise)
41 |
42 |
43 | ### CPromise.E\_REASON\_UNMOUNTED
44 | React specific canceled reason
45 |
46 | **Kind**: static property of [CPromise
](#module_CPromise)
47 |
48 |
49 | ### CPromise.async : function
50 | async decorator
51 |
52 | **Kind**: static property of [CPromise
](#module_CPromise)
53 |
54 |
55 | ### CPromise.listen : function
56 | listen decorator
57 |
58 | **Kind**: static property of [CPromise
](#module_CPromise)
59 |
60 |
61 | ### CPromise.cancel : function
62 | cancel decorator
63 |
64 | **Kind**: static property of [CPromise
](#module_CPromise)
65 |
66 |
67 | ### CPromise.ReactComponent : function
68 | cancel decorator
69 |
70 | **Kind**: static property of [CPromise
](#module_CPromise)
71 |
72 |
73 | ### CPromise.atomic : function
74 | make CPromise function atomic
75 |
76 | **Kind**: static property of [CPromise
](#module_CPromise)
77 |
78 |
79 | ### CPromise.done : function
80 | append `done` chain to the resulting promise of the decorated method
81 |
82 | **Kind**: static property of [CPromise
](#module_CPromise)
83 |
84 |
85 | ### CPromise.timeout : function
86 | timeout decorator
87 |
88 | **Kind**: static property of [CPromise
](#module_CPromise)
89 |
90 |
91 | ### CPromise.innerWeight : function
92 | innerWeight decorator
93 |
94 | **Kind**: static property of [CPromise
](#module_CPromise)
95 |
96 |
97 | ### CPromise.label : function
98 | label decorator
99 |
100 | **Kind**: static property of [CPromise
](#module_CPromise)
101 |
102 |
103 | ### CPromise.canceled : function
104 | label decorator
105 |
106 | **Kind**: static property of [CPromise
](#module_CPromise)
107 |
108 |
109 | ### CPromise.progress : function
110 | progress decorator
111 |
112 | **Kind**: static property of [CPromise
](#module_CPromise)
113 |
114 |
115 | ### CPromise.promisify : function
116 | **Kind**: static property of [CPromise
](#module_CPromise)
117 |
118 |
119 | ### CPromise~CPromise : object
120 | Creates a new CPromise instance
121 |
122 | **Kind**: inner namespace of [CPromise
](#module_CPromise)
123 | **Extends**: Promise
124 |
125 | | Param | Type | Description |
126 | | --- | --- | --- |
127 | | [executor] | CPromiseExecutorFn
| promise executor function that will be invoked in the context of the new CPromise instance |
128 | | [options] | CPromiseOptions
| |
129 |
130 |
131 | * [~CPromise](#module_CPromise..CPromise) : object
132 | * _instance_
133 | * [.signal](#module_CPromise..CPromise+signal) : AbortSignal
134 | * [.isPending](#module_CPromise..CPromise+isPending) ⇒ Boolean
135 | * [.isCanceled](#module_CPromise..CPromise+isCanceled) ⇒ Boolean
136 | * [.isCaptured](#module_CPromise..CPromise+isCaptured) ⇒ Boolean
137 | * [.isPaused](#module_CPromise..CPromise+isPaused) ⇒ Boolean
138 | * [.isRejected](#module_CPromise..CPromise+isRejected) ⇒ Boolean
139 | * [.parent](#module_CPromise..CPromise+parent) ⇒ CPromise
\| null
140 | * [.onCancel(listener)](#module_CPromise..CPromise+onCancel) ⇒ CPromise
141 | * [.onPause(listener)](#module_CPromise..CPromise+onPause) ⇒ CPromise
142 | * [.onResume(listener)](#module_CPromise..CPromise+onResume) ⇒ CPromise
143 | * [.onCapture(listener)](#module_CPromise..CPromise+onCapture) ⇒ CPromise
144 | * [.onDone(listener)](#module_CPromise..CPromise+onDone)
145 | * [.onSignal(listener)](#module_CPromise..CPromise+onSignal)
146 | * [.onSignal(signal, listener)](#module_CPromise..CPromise+onSignal)
147 | * [.totalWeight([weight])](#module_CPromise..CPromise+totalWeight) ⇒ Number
\| CPromise
148 | * [.innerWeight([weight])](#module_CPromise..CPromise+innerWeight) ⇒ Number
\| CPromise
149 | * [.progress([value], [data], [scope])](#module_CPromise..CPromise+progress) ⇒ Number
\| CPromise
150 | * [.propagate(type, data, [scope])](#module_CPromise..CPromise+propagate) ⇒ CPromise
151 | * [.captureProgress([options])](#module_CPromise..CPromise+captureProgress) ⇒ CPromise
152 | * [.scopes([pendingOnly])](#module_CPromise..CPromise+scopes) ⇒ Array.<CPromise>
153 | * [.timeout([ms])](#module_CPromise..CPromise+timeout) ⇒ Number
\| CPromise
154 | * [.weight([weight])](#module_CPromise..CPromise+weight) ⇒ Number
\| CPromise
155 | * [.label([label])](#module_CPromise..CPromise+label) ⇒ Number
\| CPromise
156 | * [.resolve(value)](#module_CPromise..CPromise+resolve) ⇒ CPromise
157 | * [.reject(err)](#module_CPromise..CPromise+reject) ⇒ CPromise
158 | * [.pause(data)](#module_CPromise..CPromise+pause) ⇒ Boolean
159 | * [.resume(data)](#module_CPromise..CPromise+resume) ⇒ Boolean
160 | * [.atomic([type])](#module_CPromise..CPromise+atomic) ⇒
161 | * [.cancel([reason], [forced])](#module_CPromise..CPromise+cancel)
162 | * [.emitSignal(type, [data], [handler], [locator])](#module_CPromise..CPromise+emitSignal) ⇒ Boolean
163 | * [.delay(ms)](#module_CPromise..CPromise+delay) ⇒ CPromise
164 | * [.aggregate([weight])](#module_CPromise..CPromise+aggregate) ⇒ CPromise
165 | * [.then(onFulfilled, [onRejected])](#module_CPromise..CPromise+then) ⇒ CPromise
166 | * [.catch(onRejected, [filter])](#module_CPromise..CPromise+catch) ⇒ CPromise
167 | * [.finally(onFinally)](#module_CPromise..CPromise+finally) ⇒ Promise.<(T\|void)>
168 | * [.done(doneHandler)](#module_CPromise..CPromise+done) ⇒ CPromise
169 | * [.canceled([onCanceled])](#module_CPromise..CPromise+canceled) ⇒ CPromise
170 | * [.listen(signal)](#module_CPromise..CPromise+listen) ⇒ CPromise
171 | * [.on(type, listener, [prepend])](#module_CPromise..CPromise+on) ⇒ CPromise
172 | * [.hasListener(event, listener)](#module_CPromise..CPromise+hasListener) ⇒ boolean
173 | * [.off(type, listener)](#module_CPromise..CPromise+off) ⇒ CPromise
174 | * [.listenersCount(type)](#module_CPromise..CPromise+listenersCount) ⇒ Number
175 | * [.hasListeners(type)](#module_CPromise..CPromise+hasListeners) ⇒ Boolean
176 | * [.once(type, listener)](#module_CPromise..CPromise+once) ⇒ CPromise
177 | * [.emit(type, ...args)](#module_CPromise..CPromise+emit) ⇒ CPromise
178 | * [.emitHook(type, ...args)](#module_CPromise..CPromise+emitHook) ⇒ Boolean
179 | * [.toString([entireChain])](#module_CPromise..CPromise+toString) ⇒ string
180 | * _static_
181 | * [.version](#module_CPromise..CPromise.version) ⇒ string
182 | * [.versionNumber](#module_CPromise..CPromise.versionNumber) ⇒ number
183 | * [.isCanceledError(thing)](#module_CPromise..CPromise.isCanceledError) ⇒ boolean
184 | * [.delay(ms, value, [options])](#module_CPromise..CPromise.delay) ⇒ CPromise
185 | * [.all(iterable, [options])](#module_CPromise..CPromise.all) ⇒ CPromise
186 | * [.race(pending)](#module_CPromise..CPromise.race) ⇒ CPromise
187 | * [.allSettled(iterable, [options])](#module_CPromise..CPromise.allSettled) ⇒ CPromise
188 | * [.retry(fn, [options])](#module_CPromise..CPromise.retry) ⇒ CPromise
189 | * [.resolve([thing], [options])](#module_CPromise..CPromise.resolve) ⇒ CPromise
190 | * [.promisify(originalFn, [options])](#module_CPromise..CPromise.promisify) ⇒ function
191 | * [.run(generatorFn, [options])](#module_CPromise..CPromise.run) ⇒ CPromise
192 | * [.async([options])](#module_CPromise..CPromise.async)
193 | * [.listen([signals])](#module_CPromise..CPromise.listen)
194 | * [.cancel([reason], signal)](#module_CPromise..CPromise.cancel)
195 | * [.canceled(onCanceledChain)](#module_CPromise..CPromise.canceled)
196 | * [.progress(onProgressHandler)](#module_CPromise..CPromise.progress)
197 | * [.ReactComponent(options)](#module_CPromise..CPromise.ReactComponent)
198 | * [.timeout(ms)](#module_CPromise..CPromise.timeout)
199 | * [.label(str)](#module_CPromise..CPromise.label)
200 | * [.innerWeight(weight)](#module_CPromise..CPromise.innerWeight)
201 | * [.atomic(atomicType)](#module_CPromise..CPromise.atomic)
202 | * [.done(doneHandler)](#module_CPromise..CPromise.done)
203 | * [.isPromisifiedFn(fn)](#module_CPromise..CPromise.isPromisifiedFn) ⇒ \*
\| boolean
204 | * [.isCPromise(thing, [anyVersion])](#module_CPromise..CPromise.isCPromise) ⇒ boolean
205 |
206 |
207 |
208 | #### cPromise.signal : AbortSignal
209 | get promise abort signal object
210 |
211 | **Kind**: instance property of [CPromise
](#module_CPromise..CPromise)
212 |
213 |
214 | #### cPromise.isPending ⇒ Boolean
215 | indicates if the promise is pending
216 |
217 | **Kind**: instance property of [CPromise
](#module_CPromise..CPromise)
218 |
219 |
220 | #### cPromise.isCanceled ⇒ Boolean
221 | indicates if the promise is pending
222 |
223 | **Kind**: instance property of [CPromise
](#module_CPromise..CPromise)
224 |
225 |
226 | #### cPromise.isCaptured ⇒ Boolean
227 | indicates if the promise progress is captured
228 |
229 | **Kind**: instance property of [CPromise
](#module_CPromise..CPromise)
230 |
231 |
232 | #### cPromise.isPaused ⇒ Boolean
233 | indicates if the promise chain is paused
234 |
235 | **Kind**: instance property of [CPromise
](#module_CPromise..CPromise)
236 |
237 |
238 | #### cPromise.isRejected ⇒ Boolean
239 | indicates if the promise is rejected
240 |
241 | **Kind**: instance property of [CPromise
](#module_CPromise..CPromise)
242 |
243 |
244 | #### cPromise.parent ⇒ CPromise
\| null
245 | get parent promise
246 |
247 | **Kind**: instance property of [CPromise
](#module_CPromise..CPromise)
248 |
249 |
250 | #### cPromise.onCancel(listener) ⇒ CPromise
251 | registers the listener for cancel event
252 |
253 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
254 |
255 | | Param | Type |
256 | | --- | --- |
257 | | listener | OnCancelListener
|
258 |
259 |
260 |
261 | #### cPromise.onPause(listener) ⇒ CPromise
262 | registers the listener for pause event
263 |
264 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
265 |
266 | | Param | Type |
267 | | --- | --- |
268 | | listener | OnPauseListener
|
269 |
270 |
271 |
272 | #### cPromise.onResume(listener) ⇒ CPromise
273 | registers the listener for resume event
274 |
275 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
276 |
277 | | Param | Type |
278 | | --- | --- |
279 | | listener | OnResumeListener
|
280 |
281 |
282 |
283 | #### cPromise.onCapture(listener) ⇒ CPromise
284 | registers the listener for capture event
285 |
286 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
287 |
288 | | Param | Type |
289 | | --- | --- |
290 | | listener | OnCaptureListener
|
291 |
292 |
293 |
294 | #### cPromise.onDone(listener)
295 | registers the listener for done event
296 |
297 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
298 |
299 | | Param | Type |
300 | | --- | --- |
301 | | listener | CPDoneListener
|
302 |
303 |
304 |
305 | #### cPromise.onSignal(listener)
306 | registers the listener for done event
307 |
308 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
309 |
310 | | Param | Type |
311 | | --- | --- |
312 | | listener | CPSignalListener
|
313 |
314 |
315 |
316 | #### cPromise.onSignal(signal, listener)
317 | registers the listener for done event
318 |
319 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
320 |
321 | | Param | Type |
322 | | --- | --- |
323 | | signal | Signal
|
324 | | listener | CPSignalListener
|
325 |
326 |
327 |
328 | #### cPromise.totalWeight([weight]) ⇒ Number
\| CPromise
329 | Set or get the total weight of the inner chains
330 |
331 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
332 |
333 | | Param | Type |
334 | | --- | --- |
335 | | [weight] | Number
|
336 |
337 |
338 |
339 | #### cPromise.innerWeight([weight]) ⇒ Number
\| CPromise
340 | Set or get the total weight of the inner chains
341 |
342 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
343 |
344 | | Param | Type |
345 | | --- | --- |
346 | | [weight] | Number
|
347 |
348 |
349 |
350 | #### cPromise.progress([value], [data], [scope]) ⇒ Number
\| CPromise
351 | Set promise progress
352 |
353 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
354 |
355 | | Param | Type | Description |
356 | | --- | --- | --- |
357 | | [value] | Number
| a number between [0, 1] |
358 | | [data] | \*
| any data to send for progress event listeners |
359 | | [scope] | CPromise
| CPromise scope |
360 |
361 |
362 |
363 | #### cPromise.propagate(type, data, [scope]) ⇒ CPromise
364 | emit propagate event that will propagate through each promise scope in the chain (bubbling)
365 |
366 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
367 |
368 | | Param | Type | Default | Description |
369 | | --- | --- | --- | --- |
370 | | type | String
\| symbol
| | some type to identify the data kind |
371 | | data | \*
|
| some data |
372 | | [scope] | CPromise
|
| CPromise scope |
373 |
374 |
375 |
376 | #### cPromise.captureProgress([options]) ⇒ CPromise
377 | capture initial progress state of the chain
378 |
379 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
380 |
381 | | Param | Type | Description |
382 | | --- | --- | --- |
383 | | [options] | Object
| |
384 | | options.throttle | Number
| set min interval for firing progress event |
385 | | options.innerWeight | Number
| set weight of the nested promises |
386 |
387 |
388 |
389 | #### cPromise.scopes([pendingOnly]) ⇒ Array.<CPromise>
390 | Returns all parent scopes that are in pending state
391 |
392 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
393 |
394 | | Param | Type | Default |
395 | | --- | --- | --- |
396 | | [pendingOnly] | boolean
| false
|
397 |
398 |
399 |
400 | #### cPromise.timeout([ms]) ⇒ Number
\| CPromise
401 | timeout before the promise will be canceled
402 |
403 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
404 |
405 | | Param | Type | Description |
406 | | --- | --- | --- |
407 | | [ms] | Number
| timeout in ms |
408 |
409 |
410 |
411 | #### cPromise.weight([weight]) ⇒ Number
\| CPromise
412 | Sets the promise weight in progress capturing process
413 |
414 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
415 | **Returns**: Number
\| CPromise
- returns weight if no arguments were specified
416 |
417 | | Param | Type | Description |
418 | | --- | --- | --- |
419 | | [weight] | Number
| any number greater or equal 0 |
420 |
421 |
422 |
423 | #### cPromise.label([label]) ⇒ Number
\| CPromise
424 | Sets the promise label
425 |
426 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
427 | **Returns**: Number
\| CPromise
- returns weight if no arguments were specified
428 |
429 | | Param | Type | Description |
430 | | --- | --- | --- |
431 | | [label] | String
| any string |
432 |
433 |
434 |
435 | #### cPromise.resolve(value) ⇒ CPromise
436 | Resolves the promise with given value
437 |
438 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
439 |
440 | | Param |
441 | | --- |
442 | | value |
443 |
444 |
445 |
446 | #### cPromise.reject(err) ⇒ CPromise
447 | Rejects the promise with given error
448 |
449 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
450 |
451 | | Param |
452 | | --- |
453 | | err |
454 |
455 |
456 |
457 | #### cPromise.pause(data) ⇒ Boolean
458 | Pause promise
459 |
460 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
461 |
462 | | Param | Type |
463 | | --- | --- |
464 | | data | \*
|
465 |
466 |
467 |
468 | #### cPromise.resume(data) ⇒ Boolean
469 | Resume promise
470 |
471 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
472 |
473 | | Param | Type |
474 | | --- | --- |
475 | | data | \*
|
476 |
477 |
478 |
479 | #### cPromise.atomic([type]) ⇒
480 | Make promise chain atomic (non-cancellable for external signals)
481 |
482 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
483 | **Returns**: CPromise
484 |
485 | | Param | Type |
486 | | --- | --- |
487 | | [type] | AtomicType
|
488 |
489 |
490 |
491 | #### cPromise.cancel([reason], [forced])
492 | throws the CanceledError that cause promise chain cancellation
493 |
494 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
495 |
496 | | Param | Type | Default |
497 | | --- | --- | --- |
498 | | [reason] | String
\| Error
| |
499 | | [forced] | Boolean
| false
|
500 |
501 |
502 |
503 | #### cPromise.emitSignal(type, [data], [handler], [locator]) ⇒ Boolean
504 | Emit a signal of the specific type
505 |
506 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
507 |
508 | | Param | Type |
509 | | --- | --- |
510 | | type | Signal
|
511 | | [data] | \*
|
512 | | [handler] | SignalHandler
|
513 | | [locator] | SignalLocator
|
514 |
515 |
516 |
517 | #### cPromise.delay(ms) ⇒ CPromise
518 | Returns a chain that will be resolved after specified timeout
519 |
520 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
521 |
522 | | Param | Type |
523 | | --- | --- |
524 | | ms | Number
|
525 |
526 |
527 |
528 | #### cPromise.aggregate([weight]) ⇒ CPromise
529 | Aggregate promise chain into one promise
530 |
531 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
532 |
533 | | Param | Type | Default |
534 | | --- | --- | --- |
535 | | [weight] | number
| 1
|
536 |
537 |
538 |
539 | #### cPromise.then(onFulfilled, [onRejected]) ⇒ CPromise
540 | returns a CPromise. It takes up to two arguments: callback functions for the success and failure cases of the Promise.
541 |
542 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
543 |
544 | | Param | Type |
545 | | --- | --- |
546 | | onFulfilled | onFulfilled
|
547 | | [onRejected] | onRejected
|
548 |
549 |
550 |
551 | #### cPromise.catch(onRejected, [filter]) ⇒ CPromise
552 | Catches rejection with optionally specified Error class
553 |
554 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
555 |
556 | | Param | Type |
557 | | --- | --- |
558 | | onRejected | function
|
559 | | [filter] | Error
|
560 |
561 |
562 |
563 | #### cPromise.finally(onFinally) ⇒ Promise.<(T\|void)>
564 | Add handler that will be invoked when promise settled
565 |
566 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
567 |
568 | | Param | Type |
569 | | --- | --- |
570 | | onFinally | CPFinallyHandler
|
571 |
572 |
573 |
574 | #### cPromise.done(doneHandler) ⇒ CPromise
575 | Add a handler that will be called after the promise has been fulfilled, but unlike `finally`,
the returned plain value will not be ignored
576 |
577 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
578 |
579 | | Param | Type |
580 | | --- | --- |
581 | | doneHandler | CPDoneHandler
|
582 |
583 |
584 |
585 | #### cPromise.canceled([onCanceled]) ⇒ CPromise
586 | Catches CancelError rejection
587 |
588 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
589 |
590 | | Param | Type |
591 | | --- | --- |
592 | | [onCanceled] | function
|
593 |
594 |
595 |
596 | #### cPromise.listen(signal) ⇒ CPromise
597 | Listen for abort signal
598 |
599 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
600 |
601 | | Param | Type |
602 | | --- | --- |
603 | | signal | AbortSignal
|
604 |
605 |
606 |
607 | #### cPromise.on(type, listener, [prepend]) ⇒ CPromise
608 | adds a new listener
609 |
610 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
611 |
612 | | Param | Type | Default |
613 | | --- | --- | --- |
614 | | type | EventType
| |
615 | | listener | function
| |
616 | | [prepend] | Boolean
| false
|
617 |
618 |
619 |
620 | #### cPromise.hasListener(event, listener) ⇒ boolean
621 | Check whether the listener is already registered to the specific event
622 |
623 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
624 |
625 | | Param | Type |
626 | | --- | --- |
627 | | event | EventType
|
628 | | listener | function
|
629 |
630 |
631 |
632 | #### cPromise.off(type, listener) ⇒ CPromise
633 | removes the listener
634 |
635 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
636 |
637 | | Param | Type |
638 | | --- | --- |
639 | | type | EventType
|
640 | | listener | function
|
641 |
642 |
643 |
644 | #### cPromise.listenersCount(type) ⇒ Number
645 | returns listeners count of the specific event type
646 |
647 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
648 |
649 | | Param | Type |
650 | | --- | --- |
651 | | type | EventType
|
652 |
653 |
654 |
655 | #### cPromise.hasListeners(type) ⇒ Boolean
656 | checks if there are listeners of a specific type
657 |
658 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
659 |
660 | | Param | Type |
661 | | --- | --- |
662 | | type | String
\| Symbol
|
663 |
664 |
665 |
666 | #### cPromise.once(type, listener) ⇒ CPromise
667 | add 'once' listener
668 |
669 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
670 |
671 | | Param | Type |
672 | | --- | --- |
673 | | type | EventType
|
674 | | listener | function
|
675 |
676 |
677 |
678 | #### cPromise.emit(type, ...args) ⇒ CPromise
679 | emits the event
680 |
681 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
682 |
683 | | Param | Type |
684 | | --- | --- |
685 | | type | EventType
|
686 | | ...args | |
687 |
688 |
689 |
690 | #### cPromise.emitHook(type, ...args) ⇒ Boolean
691 | Emits event as a hook. If some listener return true, this method will immediately return true as the result.
Else false will be retuned
692 |
693 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
694 |
695 | | Param | Type |
696 | | --- | --- |
697 | | type | EventType
|
698 | | ...args | |
699 |
700 |
701 |
702 | #### cPromise.toString([entireChain]) ⇒ string
703 | Render promise to String
704 |
705 | **Kind**: instance method of [CPromise
](#module_CPromise..CPromise)
706 |
707 | | Param | Type | Default | Description |
708 | | --- | --- | --- | --- |
709 | | [entireChain] | boolean
| false
| render the entire promise chain |
710 |
711 |
712 |
713 | #### CPromise.version ⇒ string
714 | CPromise version string
715 |
716 | **Kind**: static property of [CPromise
](#module_CPromise..CPromise)
717 |
718 |
719 | #### CPromise.versionNumber ⇒ number
720 | CPromise version number
721 |
722 | **Kind**: static property of [CPromise
](#module_CPromise..CPromise)
723 |
724 |
725 | #### CPromise.isCanceledError(thing) ⇒ boolean
726 | Checks if thing is an CanceledError instance
727 |
728 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
729 |
730 | | Param |
731 | | --- |
732 | | thing |
733 |
734 |
735 |
736 | #### CPromise.delay(ms, value, [options]) ⇒ CPromise
737 | Returns a CPromise that will be resolved after specified timeout
738 |
739 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
740 |
741 | | Param | Type | Default | Description |
742 | | --- | --- | --- | --- |
743 | | ms | Number
| | delay before resolve the promise with specified value |
744 | | value | | | |
745 | | [options] | object
| | |
746 | | [options.progressTick] | number
| 1000
| progress timer tick, must be >= 100ms |
747 |
748 |
749 |
750 | #### CPromise.all(iterable, [options]) ⇒ CPromise
751 | Returns a single CPromise that resolves to an array of the results of the input promises.
If one fails then other promises will be canceled immediately
752 |
753 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
754 |
755 | | Param | Type |
756 | | --- | --- |
757 | | iterable | Iterable
\| Generator
\| GeneratorFunction
\| array
|
758 | | [options] | CPAllOptions
|
759 |
760 | **Example**
761 | ```js
762 | CPromise.all(function*(){
yield axios.get(url1);
yield axios.get(url2);
yield axios.get(url3);
}, {concurrency: 1}).then(console.log)
763 | ```
764 |
765 |
766 | #### CPromise.race(pending) ⇒ CPromise
767 | returns a promise that fulfills or rejects as soon as one of the promises in an iterable fulfills or rejects,
with the value or reason from that promise. Other pending promises will be canceled immediately
768 |
769 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
770 |
771 | | Param | Type |
772 | | --- | --- |
773 | | pending | Iterable
|
774 |
775 |
776 |
777 | #### CPromise.allSettled(iterable, [options]) ⇒ CPromise
778 | returns a promise that resolves after all of the given promises have either fulfilled or rejected
779 |
780 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
781 |
782 | | Param | Type |
783 | | --- | --- |
784 | | iterable | Iterable
\| Generator
\| GeneratorFunction
|
785 | | [options] | CPAllOptions
|
786 |
787 |
788 |
789 | #### CPromise.retry(fn, [options]) ⇒ CPromise
790 | Retry async operation
791 |
792 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
793 |
794 | | Param | Type | Default |
795 | | --- | --- | --- |
796 | | fn | CPGeneratorRetryFunction
\| CPRetryFunction
| |
797 | | [options] | Object
| |
798 | | [options.args] | Array
| |
799 | | [options.retries] | Number
| |
800 | | [options.delayWeight] | Number
| |
801 | | [options.delay] | Number
\| CPRetryDelayResolver
| |
802 | | [options.scopeArg] | Boolean
| false
|
803 |
804 |
805 |
806 | #### CPromise.resolve([thing], [options]) ⇒ CPromise
807 | Converts thing to CPromise using the following rules:
- CPromise instance returns as is
- Objects with special method defined with key `Symbol.for('toCPromise')` will be converted using this method
The result will be cached for future calls
- Thenable wraps into a new CPromise instance, if thenable has the `cancel` method it will be used for canceling
- Generator function will be resolved to CPromise
- Array will be resoled via `CPromise.all`, arrays with one element (e.g. `[[1000]]`) will be resolved via `CPromise.race`
This method returns null if the conversion failed.
808 |
809 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
810 |
811 | | Param | Type |
812 | | --- | --- |
813 | | [thing] | \*
|
814 | | [options] | resolveOptionsObject
\| Boolean
|
815 |
816 |
817 |
818 | #### CPromise.promisify(originalFn, [options]) ⇒ function
819 | Converts callback styled function|GeneratorFn|AsyncFn to CPromise async function
820 |
821 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
822 |
823 | | Param | Type |
824 | | --- | --- |
825 | | originalFn | function
\| GeneratorFunction
\| AsyncFunction
|
826 | | [options] | PromisifyOptions
\| function
\| Boolean
|
827 |
828 |
829 |
830 | #### CPromise.run(generatorFn, [options]) ⇒ CPromise
831 | Resolves the generator to an CPromise instance
832 |
833 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
834 |
835 | | Param | Type | Description |
836 | | --- | --- | --- |
837 | | generatorFn | GeneratorFunction
| |
838 | | [options] | Object
| |
839 | | [options.args] | Array
| |
840 | | [options.resolveSignatures] | Boolean
| resolve extra signatures (like arrays with CPromise.all) |
841 | | [options.scopeArg] | Boolean
| pass the CPromise scope as the first argument to the generator function |
842 | | [options.context] | \*
| |
843 |
844 |
845 |
846 | #### CPromise.async([options])
847 | Decorator to make CPromise async function from generator, ECMA async or callback-styled method
848 |
849 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
850 |
851 | | Param | Type |
852 | | --- | --- |
853 | | [options] | object
|
854 | | [options.timeout] | number
|
855 | | [options.label] | string
|
856 | | [options.innerWeight] | number
|
857 | | [options.weight] | number
|
858 | | [options.listen] | AbortControllerId
\| AbortController
\| AbortSignal
\| Array.<(AbortControllerId\|AbortController\|AbortSignal)>
|
859 | | [options.atomic] | AtomicType
|
860 |
861 |
862 |
863 | #### CPromise.listen([signals])
864 | Decorator to subscribe CPromise async method to the internal or external controller
865 |
866 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
867 |
868 | | Param | Type |
869 | | --- | --- |
870 | | [signals] | AbortControllerId
\| AbortController
\| AbortSignal
\| Array.<(AbortControllerId\|AbortController\|AbortSignal)>
|
871 |
872 |
873 |
874 | #### CPromise.cancel([reason], signal)
875 | Decorator to cancel internal or external abort controller before the decorated function invocation.
Can be used as a plain function by passing a object context with `.call` or `.apply` methods
876 |
877 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
878 |
879 | | Param | Type |
880 | | --- | --- |
881 | | [reason] | string
|
882 | | signal | AbortControllerId
\| AbortController
|
883 |
884 | **Example**
885 | ```js
886 | el.onclick= ()=> cancel.call(this, reason, 'myControllerId'); - to use the decorator as a plain function
887 | ```
888 |
889 |
890 | #### CPromise.canceled(onCanceledChain)
891 | Decorator to add an `onCanceled` rejection handler to the resulting promise of the decorated method
892 |
893 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
894 |
895 | | Param | Type |
896 | | --- | --- |
897 | | onCanceledChain | function
\| GeneratorFunction
|
898 |
899 |
900 |
901 | #### CPromise.progress(onProgressHandler)
902 | Decorator to subscribe the handler to the `onProgress` event of the resulting promise
903 |
904 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
905 |
906 | | Param | Type |
907 | | --- | --- |
908 | | onProgressHandler | ProgressDecoratorHandler
|
909 |
910 |
911 |
912 | #### CPromise.ReactComponent(options)
913 | Decorate class as React component
914 |
915 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
916 |
917 | | Param | Type |
918 | | --- | --- |
919 | | options | boolean
\| ReactComponentDecoratorOptions
|
920 |
921 |
922 |
923 | #### CPromise.timeout(ms)
924 | Decorator to set timeout for the resulting promise of the decorated function
925 |
926 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
927 |
928 | | Param | Type |
929 | | --- | --- |
930 | | ms | number
|
931 |
932 |
933 |
934 | #### CPromise.label(str)
935 | Decorator to set label for the resulting promise of the decorated function
936 |
937 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
938 |
939 | | Param | Type |
940 | | --- | --- |
941 | | str | string
|
942 |
943 |
944 |
945 | #### CPromise.innerWeight(weight)
946 | Decorator to set innerWeight for the resulting promise of the decorated function
947 |
948 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
949 |
950 | | Param | Type |
951 | | --- | --- |
952 | | weight | number
|
953 |
954 |
955 |
956 | #### CPromise.atomic(atomicType)
957 | Decorator to set timeout for the resulting promise of the decorated function
958 |
959 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
960 |
961 | | Param | Type |
962 | | --- | --- |
963 | | atomicType | AtomicType
|
964 |
965 |
966 |
967 | #### CPromise.done(doneHandler)
968 | append `done` chain to the resulting promise of the decorated method
969 |
970 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
971 |
972 | | Param | Type |
973 | | --- | --- |
974 | | doneHandler | CPDecoratorDoneHandler
|
975 |
976 |
977 |
978 | #### CPromise.isPromisifiedFn(fn) ⇒ \*
\| boolean
979 | Returns promisification strategy that was used to the original function
980 |
981 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
982 |
983 | | Param | Type |
984 | | --- | --- |
985 | | fn | function
|
986 |
987 |
988 |
989 | #### CPromise.isCPromise(thing, [anyVersion]) ⇒ boolean
990 | Check whether object is CPromise instance
991 |
992 | **Kind**: static method of [CPromise
](#module_CPromise..CPromise)
993 |
994 | | Param | Type | Default |
995 | | --- | --- | --- |
996 | | thing | \*
| |
997 | | [anyVersion] | boolean
| false
|
998 |
999 |
1000 |
1001 | ### CPromise~EventType : String
\| Symbol
1002 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1003 |
1004 |
1005 | ### CPromise~CPromiseExecutorFn : function
1006 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1007 | **this**: CPromise
1008 |
1009 | | Param | Type |
1010 | | --- | --- |
1011 | | resolve | function
|
1012 | | reject | function
|
1013 | | scope | CPromise
|
1014 |
1015 |
1016 |
1017 | ### CPromise~PromiseOptionsObject : Object
1018 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1019 | **Properties**
1020 |
1021 | | Name | Type | Default | Description |
1022 | | --- | --- | --- | --- |
1023 | | label | String
| | |
1024 | | timeout | Number
| | |
1025 | | weight | Number
| | |
1026 | | [nativeController] | Boolean
| false
| prefer native AbortController class as the internal signal |
1027 |
1028 |
1029 |
1030 | ### CPromise~CPromiseOptions : PromiseOptionsObject
\| String
\| Number
1031 | If value is a number it will be considered as the value for timeout option
If value is a string it will be considered as a label
1032 |
1033 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1034 |
1035 |
1036 | ### CPromise~OnCancelListener : function
1037 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1038 |
1039 | | Param | Type |
1040 | | --- | --- |
1041 | | reason | CanceledError
|
1042 |
1043 |
1044 |
1045 | ### CPromise~OnPauseListener : function
1046 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1047 |
1048 |
1049 | ### CPromise~OnResumeListener : function
1050 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1051 |
1052 |
1053 | ### CPromise~OnCaptureListener : function
1054 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1055 |
1056 | | Param | Type |
1057 | | --- | --- |
1058 | | CPromise | scope
|
1059 |
1060 |
1061 |
1062 | ### CPromise~CPDoneListener ⇒ CPromise
1063 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1064 |
1065 | | Param | Type |
1066 | | --- | --- |
1067 | | value | \*
|
1068 | | isRejected | boolean
|
1069 |
1070 |
1071 |
1072 | ### CPromise~CPSignalListener ⇒ Boolean
1073 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1074 |
1075 | | Param | Type |
1076 | | --- | --- |
1077 | | type | Signal
|
1078 | | data | \*
|
1079 |
1080 |
1081 |
1082 | ### CPromise~AtomicType : number
\| boolean
\| "disabled"
\| "detached"
\| "await"
1083 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1084 |
1085 |
1086 | ### CPromise~Signal : String
\| Symbol
1087 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1088 |
1089 |
1090 | ### CPromise~SignalHandler ⇒ Boolean
1091 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1092 | **this**: {CPromise}
1093 |
1094 | | Param | Type |
1095 | | --- | --- |
1096 | | data | \*
|
1097 | | type | Signal
|
1098 | | scope | CPromise
|
1099 |
1100 |
1101 |
1102 | ### CPromise~SignalLocator ⇒ Boolean
1103 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1104 | **this**: {CPromise}
1105 |
1106 | | Param | Type |
1107 | | --- | --- |
1108 | | data | \*
|
1109 | | type | Signal
|
1110 | | scope | CPromise
|
1111 | | isRoot | Boolean
|
1112 |
1113 |
1114 |
1115 | ### CPromise~CPFinallyHandler : function
1116 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1117 | **this**: CPromise
1118 |
1119 | | Param | Type |
1120 | | --- | --- |
1121 | | settledValue | \*
|
1122 | | isRejected | boolean
|
1123 | | scope | CPromise
|
1124 |
1125 |
1126 |
1127 | ### CPromise~CPDoneHandler : function
1128 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1129 | **this**: CPromise
1130 |
1131 | | Param | Type |
1132 | | --- | --- |
1133 | | settledValue | \*
|
1134 | | isRejected | boolean
|
1135 | | scope | CPromise
|
1136 |
1137 |
1138 |
1139 | ### CPromise~CPAllOptions : object
1140 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1141 | **Properties**
1142 |
1143 | | Name | Type | Description |
1144 | | --- | --- | --- |
1145 | | [concurrency] | number
| limit concurrency of promise being run simultaneously |
1146 | | [mapper] | function
| function to map each element |
1147 | | [ignoreResults] | boolean
| do not collect results |
1148 | | [signatures] | boolean
| use advanced signatures for vales resolving |
1149 |
1150 |
1151 |
1152 | ### CPromise~CPRetryFunction ⇒ \*
1153 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1154 |
1155 | | Param | Type |
1156 | | --- | --- |
1157 | | attempt | number
|
1158 | | args | array
|
1159 |
1160 |
1161 |
1162 | ### CPromise~CPGeneratorRetryFunction ⇒ \*
1163 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1164 |
1165 | | Param | Type |
1166 | | --- | --- |
1167 | | scope | CPromise
|
1168 | | attempt | number
|
1169 | | args | array
|
1170 |
1171 |
1172 |
1173 | ### CPromise~CPRetryDelayResolver ⇒ number
1174 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1175 | **Returns**: number
- a delay in ms before next attempt
1176 |
1177 | | Param | Type |
1178 | | --- | --- |
1179 | | attempt | number
|
1180 | | retries | number
|
1181 |
1182 |
1183 |
1184 | ### CPromise~resolveOptionsObject : Object
1185 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1186 | **Properties**
1187 |
1188 | | Name | Type | Default |
1189 | | --- | --- | --- |
1190 | | [resolveSignatures] | Boolean
| true
|
1191 | | [atomic] | AtomicType
| true
|
1192 | | [args] | \*
| |
1193 |
1194 |
1195 |
1196 | ### CPromise~PromisifyFinalizeFn : function
1197 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1198 |
1199 | | Param | Type |
1200 | | --- | --- |
1201 | | result | \*
|
1202 | | scope | CPromise
|
1203 |
1204 |
1205 |
1206 | ### CPromise~CPPromisifyDecoratorFn ⇒ function
1207 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1208 |
1209 | | Param | Type | Description |
1210 | | --- | --- | --- |
1211 | | originalFn | function
| function to decorate |
1212 | | options | PromisifyOptions
| |
1213 |
1214 |
1215 |
1216 | ### CPromise~PromisifyOptions : Object
1217 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1218 | **Properties**
1219 |
1220 | | Name | Type | Default | Description |
1221 | | --- | --- | --- | --- |
1222 | | [multiArgs] | Boolean
| | aggregate all passed arguments to an array |
1223 | | [finalize] | PromisifyFinalizeFn
| | aggregate all passed arguments to an array |
1224 | | [fnType] | "plain"
\| "generator"
\| "async"
| | |
1225 | | [scopeArg] | boolean
| | pass the CPromise scope as the first argument to the generator function |
1226 | | [decorator] | function
| | CPPromisifyDecoratorFn |
1227 | | [alignArgs] | boolean
| | align passed arguments to function definition for callback-styled function |
1228 | | [once] | boolean
| true
| don't promisify already promisified function |
1229 | | [types] | array.<('plain'\|'async'\|'generator')>
| | function types to promisify |
1230 |
1231 |
1232 |
1233 | ### CPromise~AbortControllerId : string
\| symbol
1234 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1235 |
1236 |
1237 | ### CPromise~ProgressDecoratorHandler : function
1238 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1239 |
1240 | | Param | Type |
1241 | | --- | --- |
1242 | | progress | number
|
1243 | | scope | CPromise
|
1244 | | data | \*
|
1245 | | context | object
|
1246 |
1247 |
1248 |
1249 | ### CPromise~ReactComponentDecoratorOptions : object
1250 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1251 | **Properties**
1252 |
1253 | | Name | Type | Default |
1254 | | --- | --- | --- |
1255 | | [subscribeAll] | boolean
| false
|
1256 | | [bindListeners] | boolean
| true
|
1257 | | [bindMethods] | boolean
| true
|
1258 |
1259 |
1260 |
1261 | ### CPromise~CPDecoratorDoneHandler : function
1262 | **Kind**: inner typedef of [CPromise
](#module_CPromise)
1263 |
1264 | | Param | Type |
1265 | | --- | --- |
1266 | | value | \*
|
1267 | | isRejected | boolean
|
1268 | | scope | CPromise
|
1269 | | context | object
|
1270 |
1271 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ### Changelog
2 |
3 | All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4 |
5 | Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6 |
7 | #### [v0.13.12](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.11...v0.13.12)
8 |
9 | - Fixed progress capturing support for `CPromise.run` method; [`d5fead1`](https://github.com/DigitalBrainJS/c-promise/commit/d5fead1b977028df82c31b109ed68f4ad3176740)
10 |
11 | #### [v0.13.11](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.10...v0.13.11)
12 |
13 | > 31 January 2022
14 |
15 | - Added support for signal filter parameter in `onSignal` method; [`104654a`](https://github.com/DigitalBrainJS/c-promise/commit/104654a8154d4156dbaa689f762a91b3bb5b0a2b)
16 |
17 | #### [v0.13.10](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.9...v0.13.10)
18 |
19 | > 31 January 2022
20 |
21 | - Fixed atomic support in generators context by the `CPromise.run` method; [`2366f27`](https://github.com/DigitalBrainJS/c-promise/commit/2366f2741cd5920ff3634b03f7af02d630549c0d)
22 |
23 | #### [v0.13.9](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.8...v0.13.9)
24 |
25 | > 29 January 2022
26 |
27 | - Improved progress throttling logic; [`185dd8a`](https://github.com/DigitalBrainJS/c-promise/commit/185dd8a0ec5454ce8b999885518ef55ee7870d61)
28 | - Fixed README.md; [`1d741fe`](https://github.com/DigitalBrainJS/c-promise/commit/1d741fe895f15fda1d72f867df2169389863ff26)
29 |
30 | #### [v0.13.8](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.7...v0.13.8)
31 |
32 | > 17 October 2021
33 |
34 | - Refactored README.md; [`e939c51`](https://github.com/DigitalBrainJS/c-promise/commit/e939c51f5bcae191700e8e457341e966ca9d7457)
35 | - Added Wiki link; [`38802f7`](https://github.com/DigitalBrainJS/c-promise/commit/38802f735287c9ea0e045ac0dac4843d2e1f5999)
36 |
37 | #### [v0.13.7](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.6...v0.13.7)
38 |
39 | > 24 May 2021
40 |
41 | - Fixed `retry` method to catch sync errors; [`14ddfb8`](https://github.com/DigitalBrainJS/c-promise/commit/14ddfb8e3978a80f75129158785f1699041307e4)
42 |
43 | #### [v0.13.6](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.5...v0.13.6)
44 |
45 | > 24 May 2021
46 |
47 | - Fixed `retry` method; [`1f678be`](https://github.com/DigitalBrainJS/c-promise/commit/1f678be9057c02cf7f4ddc7539222ff6d1d153c7)
48 |
49 | #### [v0.13.5](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.4...v0.13.5)
50 |
51 | > 21 May 2021
52 |
53 | - Added support for propagation pause and resume events; [`acc8995`](https://github.com/DigitalBrainJS/c-promise/commit/acc899575e475fc72e78a1c1cc745c7c12e75ad0)
54 |
55 | #### [v0.13.4](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.3...v0.13.4)
56 |
57 | > 20 May 2021
58 |
59 | - Fixed version injection by the build flow; [`7d03432`](https://github.com/DigitalBrainJS/c-promise/commit/7d03432e0087e11eb1e524595aaf8673b3071825)
60 | - Fixed a bug due to which wrong values passed to the `done` event listeners on promise fulfill; [`82964ed`](https://github.com/DigitalBrainJS/c-promise/commit/82964ed0a325edcee59eedeef75cb0af728a5281)
61 |
62 | #### [v0.13.3](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.2...v0.13.3)
63 |
64 | > 13 May 2021
65 |
66 | - Fixed a bug with determining the presence of a native AbortController; [`a5a1394`](https://github.com/DigitalBrainJS/c-promise/commit/a5a1394dcd1d961f3e2a0378bbd5865ee8fde097)
67 |
68 | #### [v0.13.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.1...v0.13.2)
69 |
70 | > 12 May 2021
71 |
72 | - Fixed getFnType logic [`#2`](https://github.com/DigitalBrainJS/c-promise/pull/2)
73 | - Refactored to avoid using constructor names; [`190747a`](https://github.com/DigitalBrainJS/c-promise/commit/190747a8e010f7c222639ca87913d9357f61cdda)
74 |
75 | #### [v0.13.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.13.0...v0.13.1)
76 |
77 | > 8 May 2021
78 |
79 | - Added the ability for the all, race, allSettled methods to take into account the atomic type of the nested chain; [`4008a2e`](https://github.com/DigitalBrainJS/c-promise/commit/4008a2eb6e80ac707e2ad89ee4acf6ffa5d6bcba)
80 |
81 | #### [v0.13.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.12.5...v0.13.0)
82 |
83 | > 7 May 2021
84 |
85 | - Removed `CPromise.from` method; [`b79f8c5`](https://github.com/DigitalBrainJS/c-promise/commit/b79f8c54e62729409ab4e590c11189e1711cf1a4)
86 |
87 | #### [v0.12.5](https://github.com/DigitalBrainJS/c-promise/compare/v0.12.4...v0.12.5)
88 |
89 | > 5 May 2021
90 |
91 | - Fixed a bug with capturing the progress of a generator with nested chains; [`7d1b6ae`](https://github.com/DigitalBrainJS/c-promise/commit/7d1b6ae88b1d9070e14d85c16ad80da9c6c2d0b3)
92 |
93 | #### [v0.12.4](https://github.com/DigitalBrainJS/c-promise/compare/v0.12.3...v0.12.4)
94 |
95 | > 2 May 2021
96 |
97 | - Fixed @ReactComponent bug; [`2d75308`](https://github.com/DigitalBrainJS/c-promise/commit/2d753082a168d54ea7e98bbfb745f9cf4769c09b)
98 |
99 | #### [v0.12.3](https://github.com/DigitalBrainJS/c-promise/compare/v0.12.2...v0.12.3)
100 |
101 | > 1 May 2021
102 |
103 | - Added the ability to omit the empty `componentWillUnmount` method while still being able to automatically cancel async routines on unmount; [`d5685d3`](https://github.com/DigitalBrainJS/c-promise/commit/d5685d3b594f6855295981136a79de1d798e5f20)
104 |
105 | #### [v0.12.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.12.1...v0.12.2)
106 |
107 | > 29 April 2021
108 |
109 | - Added `bindMethods` and `bindListeners` options for the @ReactComponent decorator; [`4e86048`](https://github.com/DigitalBrainJS/c-promise/commit/4e860487cdf69423f9daac43daf2bce85f6b5db5)
110 |
111 | #### [v0.12.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.12.0...v0.12.1)
112 |
113 | > 27 April 2021
114 |
115 | - Fixed `finally` method; [`4239923`](https://github.com/DigitalBrainJS/c-promise/commit/423992300c5134e131f9d6bc667a9fa723f47767)
116 | - Added @rollup/plugin-json to the build flow; [`d9d5dcc`](https://github.com/DigitalBrainJS/c-promise/commit/d9d5dcc1eb7827a03e39f2ee741fc75c32872d82)
117 |
118 | #### [v0.12.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.11...v0.12.0)
119 |
120 | > 26 April 2021
121 |
122 | - Reworked decorators system; [`f50ff58`](https://github.com/DigitalBrainJS/c-promise/commit/f50ff586de72e67f4e92a64307581306f051e0bc)
123 | - Added playground/build to .gitignore; [`c8f3058`](https://github.com/DigitalBrainJS/c-promise/commit/c8f3058b433051b626d276ae406ffec62bfdcf55)
124 | - Updated README; [`98724eb`](https://github.com/DigitalBrainJS/c-promise/commit/98724eb48cdb5a55f4fdce52bdf842773bac0790)
125 | - Updated README; [`9c04744`](https://github.com/DigitalBrainJS/c-promise/commit/9c04744f51e5dcdd50dffedb09e3bd90afc8693f)
126 | - Added `@ReactComponent` decorator test; [`71282be`](https://github.com/DigitalBrainJS/c-promise/commit/71282be8bb0b56b45ff479593d55c81aea12e136)
127 | - Updated package.json; [`2ab6b92`](https://github.com/DigitalBrainJS/c-promise/commit/2ab6b92301e6ef9c144fde67e0e2393f3e09b7d6)
128 |
129 | #### [v0.11.11](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.10...v0.11.11)
130 |
131 | > 21 April 2021
132 |
133 | - Fixed bug with context for `onDone` shortcut method; [`95d1c01`](https://github.com/DigitalBrainJS/c-promise/commit/95d1c016f168087f64e7468929deca32ffccd90e)
134 |
135 | #### [v0.11.10](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.9...v0.11.10)
136 |
137 | > 21 April 2021
138 |
139 | - Fixed `promisify` bug with scope passing to the original function; [`5d6e32c`](https://github.com/DigitalBrainJS/c-promise/commit/5d6e32c385ee8f410fc292bc2f576256fd496e48)
140 |
141 | #### [v0.11.9](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.8...v0.11.9)
142 |
143 | > 20 April 2021
144 |
145 | - Improved `toString()` logic; [`7876164`](https://github.com/DigitalBrainJS/c-promise/commit/7876164afc29843b83f9d226383590ed5c942228)
146 |
147 | #### [v0.11.8](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.7...v0.11.8)
148 |
149 | > 19 April 2021
150 |
151 | - Fixed cancellation of the `allSettled` method; [`6862b8f`](https://github.com/DigitalBrainJS/c-promise/commit/6862b8f16d15e0eef31e1d44993333f374f40261)
152 |
153 | #### [v0.11.7](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.6...v0.11.7)
154 |
155 | > 18 April 2021
156 |
157 | - Added `decorator` option for the `.promisify` method; [`63e7895`](https://github.com/DigitalBrainJS/c-promise/commit/63e7895e4747560ed348f36975875806b7d1ce84)
158 |
159 | #### [v0.11.6](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.5...v0.11.6)
160 |
161 | > 17 April 2021
162 |
163 | - Fix: improved `.delay` timer disposing logic; [`4de5852`](https://github.com/DigitalBrainJS/c-promise/commit/4de5852e4f3f7871362bddf5ade3690e31d18c30)
164 |
165 | #### [v0.11.5](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.4...v0.11.5)
166 |
167 | > 17 April 2021
168 |
169 | - Added the ability for `.delay` to notify intermediate progress values; [`eb32ab5`](https://github.com/DigitalBrainJS/c-promise/commit/eb32ab5021e7dcaa085d5196cc6068309c9fb67b)
170 |
171 | #### [v0.11.4](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.3...v0.11.4)
172 |
173 | > 16 April 2021
174 |
175 | - Fixed bug with progress capturing of nested chains; [`15c0c0c`](https://github.com/DigitalBrainJS/c-promise/commit/15c0c0c22be5f484d613de2c8d5b94a5f0493fd5)
176 | - Fixed npm docs script; [`f5ac87d`](https://github.com/DigitalBrainJS/c-promise/commit/f5ac87d1482e29e7c36965d3f783c3b076aec763)
177 | - Added comparison table; [`6fabc2d`](https://github.com/DigitalBrainJS/c-promise/commit/6fabc2dd5abda65f50115b759fef6cf4a6efdf6f)
178 | - Fixed README.md section with retry usage examples; [`6640360`](https://github.com/DigitalBrainJS/c-promise/commit/6640360fdbb256d26addab8e54ad2720a8ff26b5)
179 | - Fixed JSDoc types for the `.toString()`; [`e9a48d3`](https://github.com/DigitalBrainJS/c-promise/commit/e9a48d3e6750184ba44b2fbeb2d255a4fa4116e6)
180 |
181 | #### [v0.11.3](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.2...v0.11.3)
182 |
183 | > 13 April 2021
184 |
185 | - Fixed a potential bug with late internal event listeners appending; [`6e3e0b2`](https://github.com/DigitalBrainJS/c-promise/commit/6e3e0b263ad08b5821f96d8443b8c9f481f25ad2)
186 | - Fixed build badge link; [`1bbe995`](https://github.com/DigitalBrainJS/c-promise/commit/1bbe9950c7f74b95fe873fb43870d11a70dc0114)
187 |
188 | #### [v0.11.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.1...v0.11.2)
189 |
190 | > 13 April 2021
191 |
192 | - Fixed a bug with `_objectToCPromise` that happens if the `thing` has nullable value; [`7daa396`](https://github.com/DigitalBrainJS/c-promise/commit/7daa3966fa01ce4d46799f1f7ca3c0a98aa2fcc9)
193 |
194 | #### [v0.11.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.11.0...v0.11.1)
195 |
196 | > 13 April 2021
197 |
198 | - Updated auto-changelog config; [`82aeccd`](https://github.com/DigitalBrainJS/c-promise/commit/82aeccd461fa4102ef2122e37117244d177f5af7)
199 | - Fixed a bug with generator progress capturing, if onProgress listener was attached before the first yield; [`8bb1161`](https://github.com/DigitalBrainJS/c-promise/commit/8bb1161cf9a7555e9c8fb1bb72c863165f9c2172)
200 |
201 | #### [v0.11.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.8...v0.11.0)
202 |
203 | > 13 April 2021
204 |
205 | - Removed `scope` argument that was previously passed to generators as the last argument; [`e78b2d6`](https://github.com/DigitalBrainJS/c-promise/commit/e78b2d6dba32e1ac3e85007d405c8a492874f0b9)
206 |
207 | #### [v0.10.8](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.7...v0.10.8)
208 |
209 | > 13 December 2020
210 |
211 | - exported `promisify` method; [`8c9746b`](https://github.com/DigitalBrainJS/c-promise/commit/8c9746b2ba686dd7836aa6f5401297058cb3c7e2)
212 | - Added tests for `CanceledError.rethrow` method; [`e3d9f6f`](https://github.com/DigitalBrainJS/c-promise/commit/e3d9f6f8493a237e5007bb2ecae8d0856bc24a00)
213 | - spellcheck; [`895d0d6`](https://github.com/DigitalBrainJS/c-promise/commit/895d0d6bee1ea60acac56c00be64c92e10bde483)
214 | - spellcheck; [`aa32a7b`](https://github.com/DigitalBrainJS/c-promise/commit/aa32a7b2b72b7d79f3257cb43a894ce34315ec1c)
215 |
216 | #### [v0.10.7](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.6...v0.10.7)
217 |
218 | > 12 December 2020
219 |
220 | - Added promisify method; [`b07585d`](https://github.com/DigitalBrainJS/c-promise/commit/b07585d0cc14dd00767c81dd02e04b3015752287)
221 | - Updated README; [`96ed673`](https://github.com/DigitalBrainJS/c-promise/commit/96ed67344eb89ba17c002d04d578880499b0b0e0)
222 |
223 | #### [v0.10.6](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.5...v0.10.6)
224 |
225 | > 10 December 2020
226 |
227 | - added `weight`, `innerWeight` and `label` options for the `async` decorator; [`25a1d8d`](https://github.com/DigitalBrainJS/c-promise/commit/25a1d8d0d52c3ec9c160cb471e9f0f685ce358be)
228 |
229 | #### [v0.10.5](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.4...v0.10.5)
230 |
231 | > 8 December 2020
232 |
233 | - Updated README; [`e9f1041`](https://github.com/DigitalBrainJS/c-promise/commit/e9f10415a4859805a3c6b1951ca8f923ea2b2170)
234 |
235 | #### [v0.10.4](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.3...v0.10.4)
236 |
237 | > 7 December 2020
238 |
239 | - Added @progress decorator; [`b982644`](https://github.com/DigitalBrainJS/c-promise/commit/b982644bdefb428b53c976117661890a8b097fb5)
240 | - Updated README; [`ce89805`](https://github.com/DigitalBrainJS/c-promise/commit/ce89805191c43a95451c8484c96408c15cb380d9)
241 | - Updated README; [`9b5261e`](https://github.com/DigitalBrainJS/c-promise/commit/9b5261e57549555f5582cb3f4b7cebe5ca6dbdd9)
242 |
243 | #### [v0.10.3](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.2...v0.10.3)
244 |
245 | > 7 December 2020
246 |
247 | - Fixed a bug with cleaning internal timer; [`b1b91a1`](https://github.com/DigitalBrainJS/c-promise/commit/b1b91a1650d30d1a4ee73ba2a6ad53caa57bba4c)
248 | - Updated CHANGELOG.md; [`459fdbf`](https://github.com/DigitalBrainJS/c-promise/commit/459fdbf0cfef848d109e35212dd68bcd32ab6018)
249 |
250 | #### [v0.10.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.1...v0.10.2)
251 |
252 | > 7 December 2020
253 |
254 | - Added @canceled decorator; [`7b53ca3`](https://github.com/DigitalBrainJS/c-promise/commit/7b53ca36faf9436dfdaadb978a2a4b6976ce300b)
255 |
256 | #### [v0.10.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.10.0...v0.10.1)
257 |
258 | > 7 December 2020
259 |
260 | - Refactored AbortController; [`6255fb1`](https://github.com/DigitalBrainJS/c-promise/commit/6255fb18eed4d59d380ec71754bf56d519963555)
261 | - Improved JSDoc annotation; [`5d4aafe`](https://github.com/DigitalBrainJS/c-promise/commit/5d4aafee14fac3e399c220b05b4ba0636bce7c50)
262 | - Updated CHANGELOG.md; [`37c4829`](https://github.com/DigitalBrainJS/c-promise/commit/37c4829be34e4c384eba12a62c96230d83e1259a)
263 |
264 | #### [v0.10.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.9.1...v0.10.0)
265 |
266 | > 6 December 2020
267 |
268 | - Added decorators support; [`ed3be00`](https://github.com/DigitalBrainJS/c-promise/commit/ed3be00e4009e8367a960d6912ce8d8029771608)
269 | - Updated readme; [`5eb8611`](https://github.com/DigitalBrainJS/c-promise/commit/5eb861155d0f1445bdaff4512d14b744f7de996c)
270 | - Fixed async decorator anchor in the README; [`ab1e49c`](https://github.com/DigitalBrainJS/c-promise/commit/ab1e49c375080251755a583944043843849cd7c6)
271 |
272 | #### [v0.9.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.9.0...v0.9.1)
273 |
274 | > 30 November 2020
275 |
276 | - Added generator support for the `then` method; [`ee41529`](https://github.com/DigitalBrainJS/c-promise/commit/ee415295d127915f17833fbb18b9929adf8068e2)
277 | - Refactored test for `CPromise.all`; [`4f28354`](https://github.com/DigitalBrainJS/c-promise/commit/4f28354ace5b0d502a45fa1eed8310c98b4cddbd)
278 | - Updated CHANGELOG.md; [`cfbe7cb`](https://github.com/DigitalBrainJS/c-promise/commit/cfbe7cb2ec0f10843d13886ea9ad8652f81b5b35)
279 |
280 | #### [v0.9.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.8.2...v0.9.0)
281 |
282 | > 29 November 2020
283 |
284 | - Improved cancellation logic to work properly with multi leaves chains; [`cef6c54`](https://github.com/DigitalBrainJS/c-promise/commit/cef6c544ffb0d3f81bd9113c1b5704eed621e32a)
285 | - Updated CHANGELOG.md; [`7b2ab2c`](https://github.com/DigitalBrainJS/c-promise/commit/7b2ab2c78edaafba562fb55665f860aac535f361)
286 |
287 | #### [v0.8.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.8.1...v0.8.2)
288 |
289 | > 28 November 2020
290 |
291 | - Improved README.md; [`f417c13`](https://github.com/DigitalBrainJS/c-promise/commit/f417c13d618b3d9b412166a1d491b912408e588d)
292 |
293 | #### [v0.8.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.8.0...v0.8.1)
294 |
295 | > 28 November 2020
296 |
297 | - Made the promise executor optional; [`50e6649`](https://github.com/DigitalBrainJS/c-promise/commit/50e66497077c8305315efd75b52637a4489d3b14)
298 |
299 | #### [v0.8.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.7.6...v0.8.0)
300 |
301 | > 27 November 2020
302 |
303 | - Added `canceled` method to catch CanceledError rejection; [`b5f1336`](https://github.com/DigitalBrainJS/c-promise/commit/b5f1336a42af1373c34eee35098122adb42c900e)
304 | - Added `canceled` method to catch CanceledError rejection; [`3d87a7f`](https://github.com/DigitalBrainJS/c-promise/commit/3d87a7f31c1a95fafae2e39c1f64047e2151458f)
305 |
306 | #### [v0.7.6](https://github.com/DigitalBrainJS/c-promise/compare/v0.7.5...v0.7.6)
307 |
308 | > 26 November 2020
309 |
310 | - refactored allSettled; [`a7a6829`](https://github.com/DigitalBrainJS/c-promise/commit/a7a68299b748d2cf7e59b9670184635e7f8cf532)
311 |
312 | #### [v0.7.5](https://github.com/DigitalBrainJS/c-promise/compare/v0.7.4...v0.7.5)
313 |
314 | > 26 November 2020
315 |
316 | - Fixed allSettled bug with options resolving; [`3fc84c3`](https://github.com/DigitalBrainJS/c-promise/commit/3fc84c3b7079d7b138f41bc43ca22ee11101ad7d)
317 |
318 | #### [v0.7.4](https://github.com/DigitalBrainJS/c-promise/compare/v0.7.3...v0.7.4)
319 |
320 | > 26 November 2020
321 |
322 | - Improved isCanceled state for then method; [`004f032`](https://github.com/DigitalBrainJS/c-promise/commit/004f032a32b95a2b090466762da3da4d9ec03f07)
323 |
324 | #### [v0.7.3](https://github.com/DigitalBrainJS/c-promise/compare/v0.7.2...v0.7.3)
325 |
326 | > 25 November 2020
327 |
328 | - Fixed React example anchor; [`7716058`](https://github.com/DigitalBrainJS/c-promise/commit/77160586d0c50c3d9d1d9dfd0869dbba41c81188)
329 |
330 | #### [v0.7.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.7.1...v0.7.2)
331 |
332 | > 25 November 2020
333 |
334 | - Added React example; [`d82c8a7`](https://github.com/DigitalBrainJS/c-promise/commit/d82c8a7a7ad2a21e58ca6c86eeac47df2d42c8fd)
335 |
336 | #### [v0.7.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.7.0...v0.7.1)
337 |
338 | > 25 November 2020
339 |
340 | - Added listen method; [`4af990f`](https://github.com/DigitalBrainJS/c-promise/commit/4af990fb76b54b75d63beb474a7a3de41d11397d)
341 |
342 | #### [v0.7.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.6.1...v0.7.0)
343 |
344 | > 24 November 2020
345 |
346 | - Improved signals API; [`bdddb5e`](https://github.com/DigitalBrainJS/c-promise/commit/bdddb5e55df4c6b0eb225cfe2456c04925abeb38)
347 | - Updated CHANGELOG.md; [`c2b24f1`](https://github.com/DigitalBrainJS/c-promise/commit/c2b24f1d3da72fe91305bf3fd4f00ec964cdd29f)
348 |
349 | #### [v0.6.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.6.0...v0.6.1)
350 |
351 | > 22 November 2020
352 |
353 | - Updated README.md; [`feabfe0`](https://github.com/DigitalBrainJS/c-promise/commit/feabfe0ee3d845670c6e54472508caf8a724211b)
354 |
355 | #### [v0.6.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.5.3...v0.6.0)
356 |
357 | > 22 November 2020
358 |
359 | - Added signals support; [`ee002ea`](https://github.com/DigitalBrainJS/c-promise/commit/ee002ea1cd8aafeb03d5cdd39516ff538aca2112)
360 | - Added signals support; [`25e2b0a`](https://github.com/DigitalBrainJS/c-promise/commit/25e2b0adae7c3ba92e2bf043badd76f2c73e2d24)
361 | - Fixed jsdoc docs; [`b49520a`](https://github.com/DigitalBrainJS/c-promise/commit/b49520a6012321b346f06dbddd12e05a6d97e8eb)
362 |
363 | #### [v0.5.3](https://github.com/DigitalBrainJS/c-promise/compare/v0.5.2...v0.5.3)
364 |
365 | > 17 October 2020
366 |
367 | - Updated CHANGELOG.md; [`2736ac4`](https://github.com/DigitalBrainJS/c-promise/commit/2736ac4f801db9b092142ac13adea05a5b097246)
368 | - Updated CHANGELOG.md; [`990f481`](https://github.com/DigitalBrainJS/c-promise/commit/990f481bef5f4af1b50d0dfc73c68163efb3f7ee)
369 |
370 | #### [v0.5.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.5.1...v0.5.2)
371 |
372 | > 16 October 2020
373 |
374 | - Fixed docs; [`e75ec21`](https://github.com/DigitalBrainJS/c-promise/commit/e75ec21986ce5ae7ffb8aba1245585bcd7a321f4)
375 | - Fixed bug with promise cancellation for `all` method [`c3ab73f`](https://github.com/DigitalBrainJS/c-promise/commit/c3ab73f41787e19a142893aa3dcd476545f1cc6b)
376 |
377 | #### [v0.5.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.5.0...v0.5.1)
378 |
379 | > 14 October 2020
380 |
381 | - Fixed bug with promise cancellation for `all` method [`011ff3f`](https://github.com/DigitalBrainJS/c-promise/commit/011ff3f2967d0f6d702ce23688705b0c59285431)
382 |
383 | #### [v0.5.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.4.2...v0.5.0)
384 |
385 | > 13 October 2020
386 |
387 | - Added concurrency, mapper, signatures options for `all` method; [`bcb4e63`](https://github.com/DigitalBrainJS/c-promise/commit/bcb4e63408c9caed093f433301e9ea2e89547e15)
388 |
389 | #### [v0.4.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.4.1...v0.4.2)
390 |
391 | > 25 September 2020
392 |
393 | - Updated README.md; [`f96a103`](https://github.com/DigitalBrainJS/c-promise/commit/f96a1034752c25694d14fbaafb00f4e7d8c98024)
394 |
395 | #### [v0.4.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.4.0...v0.4.1)
396 |
397 | > 24 September 2020
398 |
399 | - Updated README.md; [`55cf393`](https://github.com/DigitalBrainJS/c-promise/commit/55cf39375c467ed6fe887fb7ba94edd9e4fe46cf)
400 |
401 | #### [v0.4.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.3.2...v0.4.0)
402 |
403 | > 20 September 2020
404 |
405 | - Added outer abort signal support; [`ecf8905`](https://github.com/DigitalBrainJS/c-promise/commit/ecf890509362043a790a963484291e8614f40881)
406 | - Updated JSDoc signatures; [`cb2055c`](https://github.com/DigitalBrainJS/c-promise/commit/cb2055cec1494a62849669d806599da7f197c256)
407 | - Added CHANGELOG.md; [`86067d3`](https://github.com/DigitalBrainJS/c-promise/commit/86067d3306101fc857a662a8d8b979293e9f3a08)
408 | - Updated JSDoc signatures; [`bccee42`](https://github.com/DigitalBrainJS/c-promise/commit/bccee424084c9bdfd30074ee6065057c5a82d284)
409 |
410 | #### [v0.3.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.3.1...v0.3.2)
411 |
412 | > 17 September 2020
413 |
414 | - Introduced AsyncGeneratorScope class; [`2d1f427`](https://github.com/DigitalBrainJS/c-promise/commit/2d1f427f0a8ade2049f3db879cf611316d311104)
415 |
416 | #### [v0.3.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.3.0...v0.3.1)
417 |
418 | > 15 September 2020
419 |
420 | - Fixed CDN links; [`36e2c45`](https://github.com/DigitalBrainJS/c-promise/commit/36e2c454a39d8f48ce778f1f73428d5ee1efa51a)
421 |
422 | #### [v0.3.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.2.1...v0.3.0)
423 |
424 | > 15 September 2020
425 |
426 | - Updated README.hbs.md; [`503fc03`](https://github.com/DigitalBrainJS/c-promise/commit/503fc0358d6345d353bb83848c674fedcfe85404)
427 | - Removed plugin-replace; [`5be940a`](https://github.com/DigitalBrainJS/c-promise/commit/5be940a9e9eea87105054de56addab7e68e72eeb)
428 |
429 | #### [v0.2.1](https://github.com/DigitalBrainJS/c-promise/compare/v0.2.0...v0.2.1)
430 |
431 | > 14 September 2020
432 |
433 | - Fixed all and race methods to support iterable input; [`6829b41`](https://github.com/DigitalBrainJS/c-promise/commit/6829b41a2216211bfb4602c618159166c6d8d86e)
434 |
435 | #### [v0.2.0](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.9...v0.2.0)
436 |
437 | > 13 September 2020
438 |
439 | - Updated README.hbs.md; [`1a80ce5`](https://github.com/DigitalBrainJS/c-promise/commit/1a80ce57766dc42d3846c3285914a2fb6e7b943b)
440 | - Fixed pre-commit script; [`b6439f9`](https://github.com/DigitalBrainJS/c-promise/commit/b6439f957159274094ce91754d7e8c7f1374ca56)
441 | - Added debounce option for scope.progress; [`295d433`](https://github.com/DigitalBrainJS/c-promise/commit/295d43303a9f723eca0b3aacf5372703897fd892)
442 | - Updated README.hbs.md; [`cdaf10a`](https://github.com/DigitalBrainJS/c-promise/commit/cdaf10a42c12781f41738622dbded2efb7ace1a9)
443 | - Added package size badges; [`f52b1fe`](https://github.com/DigitalBrainJS/c-promise/commit/f52b1fe700861ee497fd0632a28f16a6b17afeef)
444 | - Fixed pre-commit script; [`f0ddee7`](https://github.com/DigitalBrainJS/c-promise/commit/f0ddee719521331e3d65e84f82e06b2dbe54ca43)
445 | - Updated package size badges; [`8eec56c`](https://github.com/DigitalBrainJS/c-promise/commit/8eec56c1ac4a7d6eaecc4aee9de20b5549bb66f1)
446 |
447 | #### [v0.1.9](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.8...v0.1.9)
448 |
449 | > 11 September 2020
450 |
451 | - Updated README.hbs.md; [`747d620`](https://github.com/DigitalBrainJS/c-promise/commit/747d620c153cca0cdea10f7e5c04f51e43fa2a7a)
452 |
453 | #### [v0.1.8](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.7...v0.1.8)
454 |
455 | > 11 September 2020
456 |
457 | - Added CPromise.from method; [`e384f6d`](https://github.com/DigitalBrainJS/c-promise/commit/e384f6d20ecb29c168ca21ce91dd1b0e2f539445)
458 | - Added timeout test; [`b41a296`](https://github.com/DigitalBrainJS/c-promise/commit/b41a29607d9cce0c82ccaf0b30afe6511a4433da)
459 |
460 | #### [v0.1.7](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.6...v0.1.7)
461 |
462 | > 11 September 2020
463 |
464 | - Fixed timeout cancellation; [`3238d79`](https://github.com/DigitalBrainJS/c-promise/commit/3238d79b89d19a768d630025a6c2298411bab044)
465 |
466 | #### [v0.1.6](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.5...v0.1.6)
467 |
468 | > 10 September 2020
469 |
470 | - Updated README.md; [`2fa1bc2`](https://github.com/DigitalBrainJS/c-promise/commit/2fa1bc2b63eb065207112d86131c3fd22d3c980a)
471 |
472 | #### [v0.1.5](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.4...v0.1.5)
473 |
474 | > 10 September 2020
475 |
476 | - Fixed build script; [`47f2b17`](https://github.com/DigitalBrainJS/c-promise/commit/47f2b172bea4ec8fda8e51cb07aeb59079ea45d1)
477 |
478 | #### [v0.1.4](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.3...v0.1.4)
479 |
480 | > 10 September 2020
481 |
482 | - Fixed prepublishOnly script; [`d1156b9`](https://github.com/DigitalBrainJS/c-promise/commit/d1156b9ea65e67f8cab9c06c4486efbc195cb91f)
483 |
484 | #### [v0.1.3](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.2...v0.1.3)
485 |
486 | > 10 September 2020
487 |
488 | - Updated .npmignore; [`3ca5cd0`](https://github.com/DigitalBrainJS/c-promise/commit/3ca5cd0cfc9e7ad56d7f1896fa9fd56439b7f69d)
489 | - Updated README.md; [`2f948dd`](https://github.com/DigitalBrainJS/c-promise/commit/2f948dde6e736fc8ecbd13a36524e55dd4f8a202)
490 |
491 | #### [v0.1.2](https://github.com/DigitalBrainJS/c-promise/compare/v0.1.1...v0.1.2)
492 |
493 | > 10 September 2020
494 |
495 | - Updated README.md; Fixed coveralls; [`323858e`](https://github.com/DigitalBrainJS/c-promise/commit/323858e6e0640ef666a6cded4c671ec051bdc82f)
496 | - Updated README.md; [`e35d155`](https://github.com/DigitalBrainJS/c-promise/commit/e35d1554e38f272af4ac94aefeb9606da7f8c64f)
497 | - Updated README.md; [`12318cd`](https://github.com/DigitalBrainJS/c-promise/commit/12318cdf39e2d9fe4bcd3c5f27138fe1fa970506)
498 | - Updated README.md; [`a5c1436`](https://github.com/DigitalBrainJS/c-promise/commit/a5c1436136a96e8b67f845de96101f686afc7c12)
499 |
500 | #### v0.1.1
501 |
502 | > 10 September 2020
503 |
504 | - Initial commit [`f932cb8`](https://github.com/DigitalBrainJS/c-promise/commit/f932cb8584ebd458d7961aba53f8f33c797bb650)
505 | - Updated README.md [`a3d3f94`](https://github.com/DigitalBrainJS/c-promise/commit/a3d3f94ad8e166d6081942bca7555d00a3f6d8e9)
506 | - Updated README.md [`7b15cb8`](https://github.com/DigitalBrainJS/c-promise/commit/7b15cb8e419624ea322c7b46bb4c6b9a05eb284a)
507 | - Updated README.md [`f13d677`](https://github.com/DigitalBrainJS/c-promise/commit/f13d6773c7eab9004b83a46d01be80a9843c3c72)
508 | - Updated README.md [`8bef0a5`](https://github.com/DigitalBrainJS/c-promise/commit/8bef0a5169fa2859d0102a98c4d77b8ede575e6c)
509 | - Updated README.md [`f4e0d36`](https://github.com/DigitalBrainJS/c-promise/commit/f4e0d36d0dbae76411ed044059759d69c89a4271)
510 | - Updated README.md [`db4b88b`](https://github.com/DigitalBrainJS/c-promise/commit/db4b88b1b9661e47f850f490fe023542e07a5e48)
511 | - Updated README.md [`06d90b2`](https://github.com/DigitalBrainJS/c-promise/commit/06d90b2cf8771b976c40288f5bed05aca360a40b)
512 | - Updated README.md [`4df153e`](https://github.com/DigitalBrainJS/c-promise/commit/4df153e676d0dbf42e982db7f0703b8d09f3a096)
513 | - Updated README.md [`ebaae6b`](https://github.com/DigitalBrainJS/c-promise/commit/ebaae6bd3452c167531932e9346107ccca75517a)
514 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2020 Mozgovoy Dmitriy Make request to endpoint with 10s+ latency
10 |Open your console to see the log
11 |Note that the related request does abort when you undo the promise chain (see the network tab in developer tools)
12 | 13 | 14 | 15 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /playground/fetch-timeout2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Make request to endpoint with 10s+ latency
10 |Open your console to see the log
11 |Note that the related request does abort when you undo the promise chain (see the network tab in developer tools)
12 | 13 | 14 | 15 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /playground/fetch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |See your console
10 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /playground/generator.js: -------------------------------------------------------------------------------- 1 | const {CPromise}= require('../lib/c-promise'); 2 | 3 | const timestamp= Date.now(); 4 | 5 | function log(message, ...values){ 6 | console.log(`[${Date.now()- timestamp}ms] ${message}`, ...values); 7 | } 8 | 9 | function fetchWithTimeout(url, options= {}) { 10 | const {timeout, ...fetchOptions}= options; 11 | return new CPromise((resolve, reject, {signal}) => { 12 | fetch(url, {...fetchOptions, signal}).then(resolve, reject) 13 | }, timeout) 14 | } 15 | 16 | const chain= CPromise.from(function*(url){ 17 | const response= yield fetchWithTimeout(url); // fetch movie info 18 | const json= response.json(); 19 | console.log(`Json: `, json); 20 | let i= 10; 21 | while (--i > 0) { 22 | yield i * 100; //wait (i * 100)ms 23 | console.log(`Iteration ${i}`); 24 | } 25 | return json.name; 26 | }, ["https://run.mocky.io/v3/753aa609-65ae-4109-8f83-9cfe365290f0?mocky-delay=5s"]) 27 | .progress(value=> log(`Progress: ${value}`)) 28 | .then(value=> log(`Done: ${value}`), err=> log(`Error: ${err}`)); 29 | 30 | //chain.cancel();// 31 | -------------------------------------------------------------------------------- /playground/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |