({resolve, promises}, subprocess)
| 24 | |
| 25 | // Wait for other streams, but stop waiting when subprocess ends |
| 26 | export const waitForConcurrentStreams = async ({resolve, promises}, subprocess) => { |
| 27 | resolve(); |
| 28 | const [isSubprocessExit] = await Promise.race([ |
| 29 | Promise.allSettled([true, subprocess]), |
| 30 | Promise.all([false, ...promises]), |
| 31 | ]); |
| 32 | return !isSubprocessExit; |
| 33 | }; |
no outgoing calls
no test coverage detected