Skip to content

Commit fb91101

Browse files
authored
docs: add TSDoc for cancelable promise list methods (#988)
1 parent 3e387e6 commit fb91101

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/autocomplete-core/src/utils/createCancelablePromiseList.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
import { CancelablePromise } from '.';
22

33
export type CancelablePromiseList<TValue> = {
4+
/**
5+
* Add a cancelable promise to the list.
6+
*
7+
* @param cancelablePromise The cancelable promise to add.
8+
*/
49
add(cancelablePromise: CancelablePromise<TValue>): CancelablePromise<TValue>;
10+
/**
11+
* Cancel all pending promises.
12+
*
13+
* Requests aren't actually stopped. All pending promises will settle, but
14+
* attached handlers won't run.
15+
*/
516
cancelAll(): void;
17+
/**
18+
* Whether there are pending promises in the list.
19+
*/
620
isEmpty(): boolean;
721
};
822

0 commit comments

Comments
 (0)