( context: BuilderContext, target: Target, overrides?: json.JsonObject, scheduleOptions?: ScheduleOptions, )
| 364 | * @param scheduleOptions Additional scheduling options. |
| 365 | */ |
| 366 | export function scheduleTargetAndForget( |
| 367 | context: BuilderContext, |
| 368 | target: Target, |
| 369 | overrides?: json.JsonObject, |
| 370 | scheduleOptions?: ScheduleOptions, |
| 371 | ): Observable<BuilderOutput> { |
| 372 | let resolve: (() => void) | null = null; |
| 373 | const promise = new Promise<void>((r) => (resolve = r)); |
| 374 | context.addTeardown(() => promise); |
| 375 | |
| 376 | return from(context.scheduleTarget(target, overrides, scheduleOptions)).pipe( |
| 377 | switchMap( |
| 378 | (run) => |
| 379 | new Observable<BuilderOutput>((observer) => { |
| 380 | const subscription = run.output.subscribe(observer); |
| 381 | |
| 382 | return () => { |
| 383 | subscription.unsubscribe(); |
| 384 | // We can properly ignore the floating promise as it's a "reverse" promise; the teardown |
| 385 | // is waiting for the resolve. |
| 386 | // eslint-disable-next-line @typescript-eslint/no-floating-promises |
| 387 | run.stop().then(resolve); |
| 388 | }; |
| 389 | }), |
| 390 | ), |
| 391 | ); |
| 392 | } |
nothing calls this directly
no test coverage detected