Skip to content

Commit

Permalink
feat: add watchAction hooks (#5661)
Browse files Browse the repository at this point in the history
  • Loading branch information
edusperoni committed Apr 6, 2022
1 parent cf4d667 commit bb3a696
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/controllers/run-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit bb3a696

Please sign in to comment.