Template
19 lines
372 B
Vue
19 lines
372 B
Vue
<script setup lang="ts">
|
|
import { useGameStore } from "~/store/game.store";
|
|
const route = useRoute();
|
|
const gameId = Number(route.params.id);
|
|
|
|
const gameStore = useGameStore();
|
|
const game = await gameStore.fetchGame(gameId);
|
|
|
|
onBeforeMount(() => {
|
|
gameStore.subscribe(gameId);
|
|
});
|
|
|
|
onUnmounted(() => {
|
|
gameStore.close();
|
|
});
|
|
</script>
|
|
|
|
<template>{{ game }}</template>
|