import { defineStore } from "pinia"; import { ref, computed } from "vue"; export const useUserStore = defineStore("user", () => { const user = ref(null); const notifications = computed(() => { return typeof user.value.notifications === "array" ? user.value.notifications : Object.values(user.value.notifications); }); return { user, notifications }; });