Skip to content

Commit

Permalink
feat(demo): add demo function to fragment development,
Browse files Browse the repository at this point in the history
fix naming in api function
  • Loading branch information
MatsJohansen87 committed Oct 2, 2024
1 parent 3ab2ebb commit 59de8e7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
22 changes: 22 additions & 0 deletions packages/demo/src/AppFragmentDevelopment.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,27 @@
getQuery();
};
const setQueryStore = (): void => {
const store: QueryItem[][] = [
[
{
id: "0cf3a74c-77f8-49a0-bef5-16e20d6b361e",
key: "gender",
name: "Geschlecht",
type: "EQUALS",
values: [
{
name: "Männlich",
value: "male",
queryBindId: "1f69dd2d-3c29-40a6-ba83-a966def1cd12",
},
],
},
],
];
dataPasser.setQueryStoreAPI(store);
};
window.addEventListener("emit-lens-query", (e) => {
const event = e as QueryEvent;
const { ast, updateResponse, abortController } = event.detail;
Expand Down Expand Up @@ -158,6 +179,7 @@
<button on:click={() => getQuery()}>Get Query Store</button>
<button on:click={() => getResponse()}>Get Response Store</button>
<button on:click={() => getAST()}>Get AST</button>
<button on:click={() => setQueryStore()}>Set Query Store</button>
{#each queryStore as queryStoreGroup}
<div>
{#each queryStoreGroup as queryStoreItem}
Expand Down
6 changes: 3 additions & 3 deletions packages/lib/src/components/DataPasser.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
/**
* sets the query store
* @param queryStore the new query store
* @param newQuery the new query store
*/
export const setQueryStoreAPI = (queryStore: QueryItem[][]): void => {
queryStore.set(queryStore);
export const setQueryStoreAPI = (newQuery: QueryItem[][]): void => {
queryStore.set(newQuery);
};
/**
Expand Down

0 comments on commit 59de8e7

Please sign in to comment.