mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Returning provided promise in addTask
This commit is contained in:
committed by
Steve Sanderson
parent
3e6f7f3e45
commit
e7ffb8bb71
@@ -7,7 +7,7 @@ const domainTaskBaseUrlStateKey = '__DOMAIN_TASK_INTERNAL_FETCH_BASEURL__DO_NOT_
|
|||||||
|
|
||||||
let noDomainBaseUrl: string;
|
let noDomainBaseUrl: string;
|
||||||
|
|
||||||
export function addTask(task: PromiseLike<any>) {
|
export function addTask<T>(task: PromiseLike<T>): PromiseLike<T> {
|
||||||
if (task && domain.active) {
|
if (task && domain.active) {
|
||||||
const state = domainContext.get(domainTasksStateKey) as DomainTasksState;
|
const state = domainContext.get(domainTasksStateKey) as DomainTasksState;
|
||||||
if (state) {
|
if (state) {
|
||||||
@@ -32,6 +32,8 @@ export function addTask(task: PromiseLike<any>) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function run<T>(codeToRun: () => T, completionCallback: (error: any) => void): T {
|
export function run<T>(codeToRun: () => T, completionCallback: (error: any) => void): T {
|
||||||
|
|||||||
Reference in New Issue
Block a user