// coreServices.ts
import { getCompositeStore } from './compositeStores';

export const coreServices = {
    updateStore: (mappings: Record<string, string>) => {
        for (const [mappingString, value] of Object.entries(mappings)) {
            const [storeID, key] = mappingString.replace('@', '').split(':');
            const store = getCompositeStore(storeID);
            store.update(storeData => {
                storeData[key] = value;
                return storeData;
            });
        }
    },
    testAlert: () => {
        alert("core service alert")
    }
};
