refactor: migrate standalone scripts to the new DI architecture
Bug: twpowertools:226
Change-Id: Ie32b0200a31626bde06f3bdb0655790bb5a76802
diff --git a/src/presentation/standaloneScripts/Scripts.ts b/src/presentation/standaloneScripts/Scripts.ts
new file mode 100644
index 0000000..7f3b602
--- /dev/null
+++ b/src/presentation/standaloneScripts/Scripts.ts
@@ -0,0 +1,16 @@
+import Script, {
+ ConcreteScript,
+} from '../../common/architecture/scripts/Script';
+import ScriptFilterListProvider from '../../common/architecture/scripts/ScriptFilterListProvider';
+
+export default class StandaloneScripts extends ScriptFilterListProvider {
+ private scripts: ConcreteScript[] = [];
+ private initializedScripts: Script[];
+
+ protected getUnfilteredScriptsList() {
+ if (this.initializedScripts === undefined) {
+ this.initializedScripts = this.scripts.map((script) => new script());
+ }
+ return this.initializedScripts;
+ }
+}