diff --git a/README.md b/README.md index 207122d..e1b76be 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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}; diff --git a/fuzzball.d.ts b/fuzzball.d.ts index c8aa930..38384f1 100644 --- a/fuzzball.d.ts +++ b/fuzzball.d.ts @@ -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; } @@ -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; }