"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchGraphSetUnitPinData = void 0;
const stringify_1 = require("../../spec/stringify");
function watchGraphSetUnitPinData(event, graph, callback) {
    const listener = (...[unitId, type, pinId, data, path]) => {
        const _data = (0, stringify_1.stringify)(data);
        callback({
            type: 'graph',
            event,
            data: {
                unitId,
                type,
                pinId,
                data: _data,
                path,
            },
        });
    };
    graph.prependListener(event, listener);
    return () => {
        graph.removeListener(event, listener);
    };
}
exports.watchGraphSetUnitPinData = watchGraphSetUnitPinData;
//# sourceMappingURL=watchGraphSetUnitPinDataEvent.js.map