"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchGraphUnitComponentAppendEvent = void 0;
function watchGraphUnitComponentAppendEvent(event, graph, callback) {
    const listener = (unitId, unitSpec, path) => {
        callback({
            type: 'graph',
            event,
            data: {
                unitId,
                unitSpec,
                path,
            },
        });
    };
    graph.prependListener(event, listener);
    return () => {
        graph.removeListener(event, listener);
    };
}
exports.watchGraphUnitComponentAppendEvent = watchGraphUnitComponentAppendEvent;
//# sourceMappingURL=watchGraphUnitComponentAppendEvent.js.map