From 5a8fdc2a00039ff32bcbe11d97f1fd1cc18e4753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Rosiek?= Date: Sat, 2 Sep 2017 19:56:47 +0200 Subject: [PATCH] Returning provided promise in `addTask` --- .../npm/domain-task/src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/main.ts b/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/main.ts index 3dfc652c..0a944d0c 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/main.ts +++ b/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/main.ts @@ -7,7 +7,7 @@ const domainTaskBaseUrlStateKey = '__DOMAIN_TASK_INTERNAL_FETCH_BASEURL__DO_NOT_ let noDomainBaseUrl: string; -export function addTask(task: PromiseLike) { +export function addTask(task: PromiseLike): PromiseLike { if (task && domain.active) { const state = domainContext.get(domainTasksStateKey) as DomainTasksState; if (state) { @@ -32,6 +32,8 @@ export function addTask(task: PromiseLike) { }); } } + + return task; } export function run(codeToRun: () => T, completionCallback: (error: any) => void): T {