Files
go_nuxt_admin/app/stores/hero.ts
Beyhan Oğur 5285a0dd86 first commit
2026-04-26 22:07:47 +03:00

18 lines
352 B
TypeScript

import { defineStore } from 'pinia';
import type { Hero } from '~~/types/hero';
interface HeroState {
hero: Hero | null;
}
export const useHeroStore = defineStore('hero', {
state: (): HeroState => ({
hero: null,
}),
actions: {
setHero(newHero: Hero | null): void {
this.hero = newHero;
}
}
});