Utilizing quasar alongside firebase 9, I am facing a challenge in setting the state with actions during the initialization of my project. My goal is to retrieve data from firebase just once and store it in an array within the Vuex state.
import { getData } from "src/firebase/config";
// Fetch data from packages collection
export const loadPackages = async () => {
const packages = await getData("packages");
return packages;
}
// Retrieve data from menu collection
export const loadMenu = async () => {
const packages = await getData("meals-menu");
return packages;
}
I am currently using the return value of each function in their respective Vue components, but I am now looking for a way to utilize the returned data to mutate the Vuex state.
Any suggestions or tips would be greatly appreciated!
Thank you.