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