"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listenGlobalComponent = exports.getGlobalComponent = void 0;
function getGlobalComponent(system, id) {
    const { global: { component: _component }, } = system;
    const component = _component[id];
    return component;
}
exports.getGlobalComponent = getGlobalComponent;
function listenGlobalComponent(system, id, callback) {
    const { emitter } = system;
    const listener = (component) => {
        callback(component);
    };
    emitter.addListener(id, listener);
    return () => {
        emitter.removeListener(id, listener);
    };
}
exports.listenGlobalComponent = listenGlobalComponent;
//# sourceMappingURL=globalComponent.js.map