()
| 54 | const promises = new Set<Promise<unknown>>() |
| 55 | |
| 56 | export async function rpcDone(): Promise<unknown[] | undefined> { |
| 57 | if (!promises.size) { |
| 58 | return |
| 59 | } |
| 60 | const awaitable = Array.from(promises) |
| 61 | return Promise.all(awaitable) |
| 62 | } |
| 63 | |
| 64 | const onCancelCallbacks: ((reason: CancelReason) => void)[] = [] |
| 65 |