firefish/packages/client/src/reactiveAccount.ts

10 lines
252 B
TypeScript
Raw Normal View History

2023-11-27 18:17:53 +09:00
import { reactive } from "vue";
2023-12-06 05:02:20 +09:00
import type { Account } from "@/account";
2023-10-29 20:09:26 +09:00
const accountData = localStorage.getItem("account");
// TODO: 外部からはreadonlyに
export const $i = accountData
? reactive(JSON.parse(accountData) as Account)
: null;