Skip to content

Commit

Permalink
asyncOffset description
Browse files Browse the repository at this point in the history
  • Loading branch information
nol13 committed Jul 24, 2019
1 parent 922247e commit ddd5e36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fuzz.extractAsync("mr. harry hood", choices, options, function (err, results){/*
// In supported environments, Promise will not be polyfilled
fuzz.extractAsPromised("mr. harry hood", choices, options).then(res => {/* do stuff */});

// Cancel search, by default only every 256th iteration is async
// Cancel search
let cancelToken = {canceled: false};
options.cancelToken = cancelToken;
fuzz.extractAsPromised("gonna get canceled", choices, options)
Expand Down Expand Up @@ -293,7 +293,7 @@ results = fuzz.extract(query, choices, options);

### Async and Cancellation

When using extractAsPromised or extractAsync, create a new object with a 'canceled' property to use as a cancel token. For performance, by default only every 256th loop will be async, but set asyncLoopOffset to change. It is nost likely not worth changing this.
When using extractAsPromised or extractAsync, create a new object with a 'canceled' property to use as a cancel token. For performance, by default only every 256th loop will be async, but set asyncLoopOffset to change. It is most likely not worth changing this.

```js
let cancelToken = {canceled: false};
Expand Down
4 changes: 2 additions & 2 deletions fuzzball.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export interface FuzzballAsyncExtractOptions extends FuzzballExtractOptions {
*/
cancelToken?: CancellationToken;
/**
* Number of loop iterations between async iteration
* Number of loop iterations between each async iteration
*/
asyncLoopOffset?: number;
}
Expand All @@ -97,7 +97,7 @@ export interface FuzzballAsyncExtractObjectOptions extends FuzzballExtractObject
*/
cancelToken?: CancellationToken;
/**
* Number of loop iterations between async iteration
* Number of loop iterations between each async iteration
*/
asyncLoopOffset?: number;
}
Expand Down

0 comments on commit ddd5e36

Please sign in to comment.