"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.channelModelAdapter = void 0;
const ChannelModelPM_1 = require("../PMs/ChannelModelPM");
exports.channelModelAdapter = {
    defaultVM: ChannelModelPM_1.defaultChannelModelVM,
    subscribe: (id, appObjects, setVM) => {
        if (!id)
            return;
        const pm = ChannelModelPM_1.ChannelModelPM.get(id, appObjects);
        if (!pm) {
            appObjects.submitError("channelModelAdapter", "Unable to find PM");
            return;
        }
        pm.addView(setVM);
    },
    unsubscribe: (id, appObjects, setVM) => {
        const pm = ChannelModelPM_1.ChannelModelPM.get(id, appObjects);
        if (!pm) {
            appObjects.submitError("channelModelAdapter", "Unable to find PM");
            return;
        }
        pm.removeView(setVM);
    },
};
//# sourceMappingURL=channelModelAdapter.js.map