import { defineStore } from 'pinia';
import { store } from '/@/store';

interface ShoppingStore {
  shoppingCartRefresh: number;
}

export const useShoppingStore = defineStore({
  id: 'app-shoppingStore',
  state: (): ShoppingStore => ({
    shoppingCartRefresh: 0,
  }),
  actions: {
    refresh() {
      this.shoppingCartRefresh++;
    },
  },
});

export function useShoppingStoreWithOut() {
  return useShoppingStore(store);
}
