[Vuejs]-Await for Pinia store state to load before performing a firestore query

0👍

I solved it using localStorage as recommended in this post
Refresh-proof your Pinia Stores

After installing @vueuse/core, I change my store code to this:

import {useLocalStorage} from "@vueuse/core";

export const useSession = defineStore("session", {
id: "store",
state: () => ({state: () => ({
user_id: useLocalStorage("user_id", ""),
}),

Leave a comment