import { ChannelModelPM, defaultChannelModelVM, } from "../PMs/ChannelModelPM";
export const channelModelAdapter = {
    defaultVM: defaultChannelModelVM,
    subscribe: (id, appObjects, setVM) => {
        if (!id)
            return;
        const pm = ChannelModelPM.get(id, appObjects);
        if (!pm) {
            appObjects.submitError("channelModelAdapter", "Unable to find PM");
            return;
        }
        pm.addView(setVM);
    },
    unsubscribe: (id, appObjects, setVM) => {
        const pm = ChannelModelPM.get(id, appObjects);
        if (!pm) {
            appObjects.submitError("channelModelAdapter", "Unable to find PM");
            return;
        }
        pm.removeView(setVM);
    },
};
//# sourceMappingURL=channelModelAdapter.js.map