|
9 | 9 | - [Installation](#installation-hammer)
|
10 | 10 | - [CDN bundle](#cdn-bundle)
|
11 | 11 | - [Usage examples](#usage-examples)
|
12 |
| - - [Request aborting using CPromise cancellation API](#request-aborting-using-cpromise-cancellation -api) |
| 12 | + - [Request aborting using CPromise cancellation API](#request-aborting-using-cpromise-cancellation-api) |
13 | 13 | - [Request aborting using AbortController signal](#request-aborting-using-abortcontroller-signal)
|
14 | 14 | - [Request aborting using Axios cancelToken](#request-aborting-using-axios-canceltoken)
|
15 | 15 | - [Using generators as async functions](#using-generators-as-async-functions)
|
@@ -48,9 +48,9 @@ module global export- `cpAxios`
|
48 | 48 |
|
49 | 49 | #### Live Example
|
50 | 50 |
|
51 |
| -[Live browser example](https://codesandbox.io/s/mutable-breeze-wdyp) |
| 51 | +[Live browser example](https://codesandbox.io/s/strange-almeida-1lcjj) |
52 | 52 |
|
53 |
| -#### Request aborting using CPromise cancellation API: |
| 53 | +#### Request aborting using CPromise cancellation API: |
54 | 54 | ````javascript
|
55 | 55 | const cpAxios= require('cp-axios');
|
56 | 56 | const url= 'https://run.mocky.io/v3/753aa609-65ae-4109-8f83-9cfe365290f0?mocky-delay=5s';
|
@@ -87,7 +87,7 @@ module global export- `cpAxios`
|
87 | 87 | });
|
88 | 88 |
|
89 | 89 | setTimeout(() => {
|
90 |
| - chain.cancel(); |
| 90 | + abortController.abort(); |
91 | 91 | }, 500);
|
92 | 92 | ````
|
93 | 93 |
|
@@ -145,7 +145,7 @@ const chain= CPromise.all([
|
145 | 145 | console.warn(`We got an error: ${err}`);
|
146 | 146 | });
|
147 | 147 |
|
148 |
| -// other request will aborted if one fails |
| 148 | +// other request will be aborted if one fails |
149 | 149 |
|
150 | 150 | // setTimeout(()=> chain.cancel(), 1000); // abort the request after 1000ms
|
151 | 151 | ````
|
|
0 commit comments