Implement food and settings stores

This commit is contained in:
2024-08-09 18:52:13 +02:00
parent 5ec2ee18b8
commit 4c2d104f49
4 changed files with 70 additions and 24 deletions

View File

@@ -1,20 +1,9 @@
<script lang="ts">
import { GetFood } from "$wails/main/App.js";
import { main } from '$wails/models'
let food: main.Food[] = [];
GetFood().then((result) => {
if (!result.success) {
console.error(result.error);
return;
}
food = result.data
console.log(food);
});
import { foodStore } from "$lib/store/FoodStore";
</script>
<template>
{#each food as f}
{#each $foodStore as f}
<div>{f.food}</div>
{/each}
</template>