Skip to content

Commit

Permalink
Updated README.hbs.md;
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrainJS committed Sep 13, 2020
1 parent b6439f9 commit cdaf10a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ const chain= fetchWithTimeout('http://localhost/', {timeout: 5000})

[Live nodejs example (runkit.com)](https://runkit.com/digitalbrainjs/runkit-npm-c-promise2)

[Using generators as a promise (jsfiddle.net)](https://jsfiddle.net/DigitalBrain/mtcuf1nj/)
[Using generator as a promise (jsfiddle.net)](https://jsfiddle.net/DigitalBrain/mtcuf1nj/)

<img src="http://g.recordit.co/E6e97qRPoY.gif" alt="Browser playground with fetch" width="50%" height="50%">

## How it works

The deepest pending CPromise in the chain will be rejected will a `CanceledError`,
then that chain and each above standing chain will emit `cancel` event. This event will be handled by
callbacks attached by `onCancel(cb)` method and propagate with signal from `AbortController`.
then if the error was not caught by the user code that chain and each above standing chain emit `cancel` event. This event will be handled by
callbacks attached by `onCancel(cb)` method and/or propagate with signal from `AbortController`.
These api can be used simultaneously. The `cancel([reason])` method is synchronous and can be called any time.
If cancellation failed (the chain has been already fulfilled) it will return `false`.

Expand Down
6 changes: 3 additions & 3 deletions jsdoc2md/README.hbs.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ const chain= fetchWithTimeout('http://localhost/', {timeout: 5000})

[Live nodejs example (runkit.com)](https://runkit.com/digitalbrainjs/runkit-npm-c-promise2)

[Using generators as a promise (jsfiddle.net)](https://jsfiddle.net/DigitalBrain/mtcuf1nj/)
[Using generator as a promise (jsfiddle.net)](https://jsfiddle.net/DigitalBrain/mtcuf1nj/)

<img src="http://g.recordit.co/E6e97qRPoY.gif" alt="Browser playground with fetch" width="50%" height="50%">

## How it works

The deepest pending CPromise in the chain will be rejected will a `CanceledError`,
then that chain and each above standing chain will emit `cancel` event. This event will be handled by
callbacks attached by `onCancel(cb)` method and propagate with signal from `AbortController`.
then if the error was not caught by the user code that chain and each above standing chain emit `cancel` event. This event will be handled by
callbacks attached by `onCancel(cb)` method and/or propagate with signal from `AbortController`.
These api can be used simultaneously. The `cancel([reason])` method is synchronous and can be called any time.
If cancellation failed (the chain has been already fulfilled) it will return `false`.

Expand Down

0 comments on commit cdaf10a

Please sign in to comment.