Files
web_server/vue/src/stores/activity.js
Adam French d3d3269d49
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 4m58s
Extract Vue frontend into separate container and add stp_wasm crate
Move Vue app from nginx/vue/ to top-level vue/ with its own Dockerfile,
update docker-compose configs and nginx proxy to serve from the new
container, and add initial Rust WASM crate (stp_wasm). Also fix .gitignore
to exclude Rust target/ directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 16:40:45 +00:00

37 lines
776 B
JavaScript

import { defineStore } from "pinia";
import { computed, ref, watch } from "vue";
import { useHomeDataStore } from "@/stores/homeData";
const activity_template = {
type: "activity",
name: "nameof",
createdAt: Date.now(),
};
export const useActivityStore = defineStore("activity", () => {
const activity = ref([activity_template]);
const activityCount = computed(() => activity.value.length);
const homeData = useHomeDataStore();
watch(
() => homeData.activities,
(newActivities) => {
if (newActivities.length > 0) {
activity.value = newActivities;
}
},
{ immediate: true },
);
async function fetchActivity() {
await homeData.fetchAll();
}
return {
activity,
activityCount,
fetchActivity,
};
});