DCSOlympus/manager/javascripts/managerfactory.js

15 lines
369 B
JavaScript

/* TODO: find a better solution without using the window object to persist the manager singleton */
function getManager() {
if (window.manager) {
return window.manager;
} else {
const Manager = require("./manager");
window.manager = new Manager();
return window.manager;
}
}
module.exports = {
getManager: getManager
};