From b043cc1532d4492c904e56b6b5ec9a5c5dc39ad0 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Tue, 5 Apr 2022 16:21:47 -0300 Subject: [PATCH] feat: add watchAction hooks --- lib/controllers/run-controller.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/controllers/run-controller.ts b/lib/controllers/run-controller.ts index 4f0ec24042..62c07915ea 100644 --- a/lib/controllers/run-controller.ts +++ b/lib/controllers/run-controller.ts @@ -759,6 +759,15 @@ export class RunController extends EventEmitter implements IRunController { // IMPORTANT: keep the same instance as we rely on side effects _.assign(liveSyncResultInfo, fullLiveSyncResultInfo); }; + await this.$hooksService.executeBeforeHooks("watchAction", { + hookArgs: { + liveSyncResultInfo, + filesToSync, + allAppFiles, + isInHMRMode, + filesChangedEvent: data, + }, + }); await this.refreshApplication( projectData, @@ -786,6 +795,13 @@ export class RunController extends EventEmitter implements IRunController { ); } } + await this.$hooksService.executeAfterHooks("watchAction", { + liveSyncResultInfo, + filesToSync, + allAppFiles, + filesChangedEvent: data, + isInHMRMode, + }); this.$logger.info( util.format(