You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ In ESM:
19
19
```ts
20
20
import {
21
21
AwaitQueue,
22
+
AwaitQueuePushOptions,
22
23
AwaitQueueTask,
23
24
AwaitQueueTaskDump,
24
25
AwaitQueueStoppedError,
@@ -31,6 +32,7 @@ Using CommonJS:
31
32
```ts
32
33
const {
33
34
AwaitQueue,
35
+
AwaitQueuePushOptions,
34
36
AwaitQueueTask,
35
37
AwaitQueueTaskDump,
36
38
AwaitQueueStoppedError,
@@ -40,6 +42,18 @@ const {
40
42
41
43
## Types
42
44
45
+
### `type AwaitQueuePushOptions`
46
+
47
+
```ts
48
+
exporttypeAwaitQueuePushOptions= {
49
+
removeOngoingTasksWithSameName?:boolean;
50
+
};
51
+
```
52
+
53
+
Options given to `awaitQueue.push()`.
54
+
55
+
-`removeOngoingTasksWithSameName`: If `true`, all previously enqueued tasks with same name will be removed and will reject with an instance of `AwaitQueueRemovedTaskError`.
56
+
43
57
### `type AwaitQueueTask`
44
58
45
59
```ts
@@ -87,13 +101,14 @@ Number of enqueued pending tasks in the queue (including the running one if any)
Accepts a task as argument and enqueues it after pending tasks. Once processed, the `push()` method resolves (or rejects) with the result (or error) returned by the given task.
94
108
95
109
-`@param task`: Asynchronous or asynchronous function.
96
-
-`@param name`: Optional task name (useful for `awaitQueue.dump()` method).
0 commit comments