class InjectionSystem { constructor(){ this.systems = {}; } depend(SystemName, system) { if(this.systems[SystemName]) return false; this.systems[SystemName] = system; return true; } inject(SystemName) { if(!this.systems[SystemName]) { console.warn("InjSys: A system was requested but not found: ", SystemName, new Error().stack); return false; } return this.systems[SystemName]; } } export default new InjectionSystem();