diff --git a/src/lib/components/refactor/ComposerWrap.svelte b/src/lib/components/refactor/ComposerWrap.svelte
index 0189c82..4ff195e 100644
--- a/src/lib/components/refactor/ComposerWrap.svelte
+++ b/src/lib/components/refactor/ComposerWrap.svelte
@@ -1,7 +1,6 @@
-
-
diff --git a/src/lib/core/refactor/queryLoader.ts b/src/lib/core/refactor/queryLoader.ts
index bc542f3..48336c5 100644
--- a/src/lib/core/refactor/queryLoader.ts
+++ b/src/lib/core/refactor/queryLoader.ts
@@ -1,6 +1,7 @@
// dataLoader.ts
import { writable } from 'svelte/store';
import dataSources from 'virtual:data-sources-list';
+import { coreServices } from './coreServices';
// The store that holds the data sets
export const queryStore = writable({});
@@ -13,4 +14,14 @@ dataSources.forEach(src => {
queryStore.update(store => ({ ...store, [src]: moduleData }));
});
-});
\ No newline at end of file
+});
+
+export function subscribeAndMapQueries(id: string, queryMap: Record) {
+ Object.entries(queryMap).forEach(([name, query]) => {
+ query.subscribe((value) => {
+ if (value) {
+ coreServices.mutateStore(id, { [name]: value });
+ }
+ });
+ });
+}
\ No newline at end of file