Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit e7ffb8b

Browse files
rosieksSteveSandersonMS
authored andcommitted
Returning provided promise in addTask
1 parent 3e6f7f3 commit e7ffb8b

File tree

1 file changed

+3
-1
lines changed
  • src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src

1 file changed

+3
-1
lines changed

src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const domainTaskBaseUrlStateKey = '__DOMAIN_TASK_INTERNAL_FETCH_BASEURL__DO_NOT_
77

88
let noDomainBaseUrl: string;
99

10-
export function addTask(task: PromiseLike<any>) {
10+
export function addTask<T>(task: PromiseLike<T>): PromiseLike<T> {
1111
if (task && domain.active) {
1212
const state = domainContext.get(domainTasksStateKey) as DomainTasksState;
1313
if (state) {
@@ -32,6 +32,8 @@ export function addTask(task: PromiseLike<any>) {
3232
});
3333
}
3434
}
35+
36+
return task;
3537
}
3638

3739
export function run<T>(codeToRun: () => T, completionCallback: (error: any) => void): T {

0 commit comments

Comments
 (0)