Refactor app orchestrator into Application with dependency injection

This commit is contained in:
thePR0M3TH3AN committed 2025-10-03 21:10:22 -04:00
1 parent ef6b8bf1cf
commit cf34e28a47
17 files changed
+525 -375

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
// js/applicationContext.js
let applicationInstance = null;
let readyPromise = Promise.resolve();
export function setApplication(app) {
applicationInstance = app || null;
}
export function getApplication() {
return applicationInstance;
}
export function setApplicationReady(promise) {
if (promise && typeof promise.then === "function") {
readyPromise = promise;
} else {
readyPromise = Promise.resolve(promise);
}
}
export function getApplicationReady() {
return readyPromise;
}