18 lines
352 B
TypeScript
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;
|
|
}
|
|
}
|
|
}); |