25 lines
530 B
TypeScript
25 lines
530 B
TypeScript
import {Account} from "~/auth/Account";
|
|
|
|
export const useAccountStore = defineStore('account', {
|
|
state: () => ({
|
|
account: undefined as Account | undefined
|
|
}),
|
|
getters: {
|
|
require: (state) =>
|
|
{
|
|
return (): Account | undefined =>
|
|
{
|
|
return state.account;
|
|
}
|
|
}
|
|
},
|
|
actions: {
|
|
init()
|
|
{
|
|
Account.get((account: Account) =>
|
|
{
|
|
this.account = account;
|
|
})
|
|
}
|
|
}
|
|
}) |