Skip to content

Commit 87c6380

Browse files
committed
Merge branch 'master' into cleanup-and-opts
2 parents 65e2c99 + 958a55d commit 87c6380

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

README.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ fuzz.extractAsPromised("mr. harry hood", choices, options).then(res => {/* do st
8484
8585
// Cancel search
8686
87-
// For Node versions 14 and below and IE, use the legacy cancelToken option instead
88-
// see the "Async and Cancellation" section below
89-
9087
const abortController = new AbortController();
9188
options.abortController = abortController;
9289
@@ -324,14 +321,12 @@ results = fuzz.extract(query, choices, options);
324321
### Async and Cancellation
325322
326323
When using extractAsPromised or extractAsync, you might want to cancel the action before it has finished.
327-
It can be done using `CancelToken` or `AbortController`.
324+
It can be done using `AbortController`.
328325
329326
For performance, by default only every 256th loop will be async, but set `asyncLoopOffset` to change. It is most likely not worth changing this.
330327
331328
**AbortController**
332329
333-
[AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) is present in modern browsers and from node version `15+`. It is currently a standard way how to cancel running operations.
334-
335330
```js
336331
// or use AbortController to cancel search
337332
const abortController = new AbortController();
@@ -348,26 +343,6 @@ fuzz.extractAsPromised("gonna get aborted", choices, options)
348343
abortController.abort();
349344
```
350345
351-
**CancelToken**
352-
353-
For older browsers and node versions you can use cancel token. It is an in
354-
355-
```js
356-
let cancelToken = { canceled: false };
357-
358-
options.cancelToken = cancelToken;
359-
options.asyncLoopOffset = 64;
360-
361-
fuzz.extractAsPromised("gonna get canceled", choices, options)
362-
.then(res => {/* do stuff */})
363-
.catch((e) => {
364-
if (e.message === 'canceled') console.log('I got canceled!')
365-
});
366-
367-
// ...
368-
369-
cancelToken.canceled = true;
370-
```
371346
372347
### Wildcards
373348

0 commit comments

Comments
 (0)