refactor(autorefresh): migrate to the new DI architecture
The presentation layer has been updated to use DI for the Autorefresh
feature.
Since it's the first feature using DI, this commit also refactors the
main and start entry points to set up the script runner using DI.
Compatibility with the old feature architecture (what we used to call
"new architecture") has been provided as well, so other features which
haven't migrated yet to use DI continue to work properly.
Bug: twpowertools:226
Change-Id: Icf97bebe761693571f3aa915a4935bc002e7c0ca
diff --git a/src/features/autoRefresh/presentation/scripts/setUp.script.ts b/src/features/autoRefresh/presentation/scripts/setUp.script.ts
new file mode 100644
index 0000000..6083e83
--- /dev/null
+++ b/src/features/autoRefresh/presentation/scripts/setUp.script.ts
@@ -0,0 +1,17 @@
+import Script from '../../../../common/architecture/scripts/Script';
+import AutoRefresh from '../../core/autoRefresh';
+
+export default class AutoRefreshSetUpScript extends Script {
+ priority = 100;
+ page: never;
+ environment: never;
+ runPhase: never;
+
+ constructor(private autoRefresh: AutoRefresh) {
+ super();
+ }
+
+ execute() {
+ this.autoRefresh.setUpHandlers();
+ }
+}