Skip to content

Commit 866cea9

Browse files
committed
feat(core): Stabilize PendingTasks Injectable (#60716)
This PR marks `PendingTasks` as stable, though the `run` function remains in dev preview. There are still questions around its return value, error handling, and whether it will be replaced by a different `task` API that would better track context through the injector/injection context. PR Close #60716
1 parent 43cc57b commit 866cea9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

goldens/public-api/core/index.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ export const PACKAGE_ROOT_URL: InjectionToken<string>;
13911391
// @public
13921392
export class PendingTasks {
13931393
add(): () => void;
1394-
run<T>(fn: () => Promise<T>): void;
1394+
run(fn: () => Promise<unknown>): void;
13951395
// (undocumented)
13961396
static ɵprov: unknown;
13971397
}

packages/core/src/pending_tasks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export class PendingTasksInternal implements OnDestroy {
111111
* ```
112112
*
113113
* @publicApi
114-
* @developerPreview
115114
*/
116115
export class PendingTasks {
117116
private readonly internalPendingTasks = inject(PendingTasksInternal);
@@ -145,8 +144,9 @@ export class PendingTasks {
145144
* ```
146145
*
147146
* @param fn The asynchronous function to execute
147+
* @developerPreview
148148
*/
149-
run<T>(fn: () => Promise<T>): void {
149+
run(fn: () => Promise<unknown>): void {
150150
const removeTask = this.add();
151151
fn().catch(this.errorHandler).finally(removeTask);
152152
}

0 commit comments

Comments
 (0)