From 9d87d93ddb12f397d268f5de978fbeb16ac91afb Mon Sep 17 00:00:00 2001 From: SuperOleg39 Date: Wed, 24 Mar 2021 14:24:43 +0300 Subject: [PATCH] Return hook result inside promise with async timer end (#4010) Co-authored-by: o.drapeza --- src/utils/timers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/timers.ts b/src/utils/timers.ts index 16699496734..5f030bbfafb 100644 --- a/src/utils/timers.ts +++ b/src/utils/timers.ts @@ -108,7 +108,10 @@ function getPluginWithTimers(plugin: any, index: number): Plugin { timeEnd(timerLabel, 4); if (result && typeof result.then === 'function') { timeStart(`${timerLabel} (async)`, 4); - result = result.then(() => timeEnd(`${timerLabel} (async)`, 4)); + result = result.then((hookResult: any) => { + timeEnd(`${timerLabel} (async)`, 4); + return hookResult; + }); } return result; };