'Vuex/quasar - mutate state from firebase 9 on boot

I'm using quasar with firebase 9. I'm trying to set the state with actions during the boot of the project. I have data in firebase that I want to load only once and assign to an array in the Vuex state. there might be a way in firebase 8 but I can't solve this problem in the newer version of firebase

    import { getData } from "src/firebase/config";

// load data from packages collection
export const loadPackages = async () => {
  const packages = await getData("packages");

    return packages;
}

// load data from menu collection
export const loadMenu = async () => {
  const packages = await getData("meals-menu");

    return packages;
}

I use the return of each function in the respective vue component but I want to use the return in mutating the vuex state.

any tips?

thank you



Solution 1:[1]

as a work around solution; try saving data from firebase into localstorage then set vuex state after localstorage is set

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user19056721