first commit
This commit is contained in:
18
app/stores/hero.ts
Normal file
18
app/stores/hero.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user