From 5e83e83941e850e00084d20de8bc149136faac8c Mon Sep 17 00:00:00 2001 From: "o.drapeza" Date: Wed, 24 Mar 2021 13:38:41 +0300 Subject: [PATCH] Return hook result inside promise with async timer end --- 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; };