We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdca2ed commit ec70158Copy full SHA for ec70158
lib/api-event-iterator.js
@@ -1,10 +1,14 @@
1
-import {on} from 'node:events';
2
-
3
export async function * asyncEventIteratorFromApi(api) {
4
- for await (const [plan] of on(api, 'run')) {
5
6
- for await (const [stateChange] of on(plan.status, 'stateChange')) {
+ for await (const plan of api.events('run')) {
+ for await (const stateChange of plan.status.events('stateChange')) {
7
yield stateChange;
+
+ if (stateChange.type === 'end' || stateChange.type === 'interrupt') {
+ break;
8
+ }
9
}
10
11
+ // todo: support multiple runs (watch mode)
12
13
14
0 commit comments