// coreServices.ts
import { getComposerStore } from './composerStores';

export const coreServices = {
    mutateData: (storeID: string, value: any) => {
        const store = getComposerStore(storeID);
        console.log(`mutateData called with storeID: ${storeID} and value: ${JSON.stringify(value)}`);
        store.update(storeData => {
            storeData.context = value;
            return storeData;
        });
    },
    subscribeData: (storeID: string) => {
        const store = getComposerStore(storeID);
        return store;
    },
    testAlert: () => {
        alert("core service alert")
    }
};