forked from noxious/client
Minor improvement
This commit is contained in:
@ -2,11 +2,13 @@ import { defineStore } from 'pinia'
|
||||
import type { ExtendedCharacter, Zone } from '@/types'
|
||||
|
||||
export const useZoneStore = defineStore('zone', {
|
||||
state: () => ({
|
||||
zone: null as Zone | null,
|
||||
characters: [] as ExtendedCharacter[],
|
||||
characterLoaded: false
|
||||
}),
|
||||
state: () => {
|
||||
return {
|
||||
zone: null as Zone | null,
|
||||
characters: [] as ExtendedCharacter[],
|
||||
characterLoaded: false
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
getCharacterById: (state) => {
|
||||
return (id: number) => state.characters.find((char) => char.id === id)
|
||||
|
Reference in New Issue
Block a user