Skip to content

Commit

Permalink
Added comparison table;
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrainJS committed Apr 14, 2021
1 parent a2cbf41 commit 6fabc2d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Why](#why-question)
- [Features](#features)
- [Installation](#installation-hammer)
- [Comparison table](#comparison-table)
- Examples:
- [cancellation & progress capturing](#progress-capturing-and-cancellation)
- [pause & resume promise](#pause--resume-promises)
Expand Down Expand Up @@ -177,6 +178,33 @@ as the default export, other exports values declared as static properties

- [production ESM version](https://unpkg.com/c-promise2/dist/c-promise.mjs)

### Comparison table

| | CPromise | BlueBird.js | p-cancelable |
|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|------------------------------------------|-----------------------------------------------------------------------|
| `.cancel()` is synchronous |* (.cancel emits a cancel signal synchronously, but the cancellation is asynchronous) |||
| No setup code required to make cancellation work ||||
| Cancellation type | asynchronous, rejection with `CanceledError` follows the special algorithm | synchronous (ignoring attached callbacks) | synchronous (ignoring attached callbacks) / asynchronous (rejecting) |
| onCancel handler to clean up internal tasks ||||
| Atomic sub-chains (protected from cancellation by upper chains) ||||
| Cancellation flows ||||
| Custom cancellation reasons ||||
| Cancellation composes with other own features, like `.all`, `.race`, `.allSettled` ||||
| Chaining/nested promise cancellation support ||||
| Generators support for “flat” coroutines (as a functional replacement for ECMA async functions) ||||
| Coroutines cancellation ||||
| Concurrency limitation ||||
| Signals/data flows ||||
| Chain progress capturing ||||
| Pause/resume support ||||
| timeouts ||||
| AbortController support (outer/inner) | ✓/✓ |||
| `.catch` errors filter ||||
| `.delay` helper ||||
| ECMA decorators for methods (legacy/current) | ✓/✓ |||
| Inherited from the native Promise ||||


### Examples
#### Progress capturing and cancellation
Basic example ([Live demo](https://codesandbox.io/s/thirsty-taussig-3nqbp?file=/src/index.js)):
Expand Down
28 changes: 28 additions & 0 deletions jsdoc2md/README.hbs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Why](#why-question)
- [Features](#features)
- [Installation](#installation-hammer)
- [Comparison table](#comparison-table)
- Examples:
- [cancellation & progress capturing](#progress-capturing-and-cancellation)
- [pause & resume promise](#pause--resume-promises)
Expand Down Expand Up @@ -177,6 +178,33 @@ as the default export, other exports values declared as static properties

- [production ESM version](https://unpkg.com/c-promise2/dist/c-promise.mjs)

### Comparison table

| | CPromise | BlueBird.js | p-cancelable |
|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|------------------------------------------|-----------------------------------------------------------------------|
| `.cancel()` is synchronous |* (.cancel emits a cancel signal synchronously, but the cancellation is asynchronous) |||
| No setup code required to make cancellation work ||||
| Cancellation type | asynchronous, rejection with `CanceledError` follows the special algorithm | synchronous (ignoring attached callbacks) | synchronous (ignoring attached callbacks) / asynchronous (rejecting) |
| onCancel handler to clean up internal tasks ||||
| Atomic sub-chains (protected from cancellation by upper chains) ||||
| Cancellation flows ||||
| Custom cancellation reasons ||||
| Cancellation composes with other own features, like `.all`, `.race`, `.allSettled` ||||
| Chaining/nested promise cancellation support ||||
| Generators support for “flat” coroutines (as a functional replacement for ECMA async functions) ||||
| Coroutines cancellation ||||
| Concurrency limitation ||||
| Signals/data flows ||||
| Chain progress capturing ||||
| Pause/resume support ||||
| timeouts ||||
| AbortController support (outer/inner) | ✓/✓ |||
| `.catch` errors filter ||||
| `.delay` helper ||||
| ECMA decorators for methods (legacy/current) | ✓/✓ |||
| Inherited from the native Promise ||||


### Examples
#### Progress capturing and cancellation
Basic example ([Live demo](https://codesandbox.io/s/thirsty-taussig-3nqbp?file=/src/index.js)):
Expand Down

0 comments on commit 6fabc2d

Please sign in to comment.