import { setCache, getCache } from '@/utils/cache';

export default {
  state: () => ({
    location: getCache('location') || {
      longitude: 0,
      latitude: 0,
    },
    categories:getCache('categories') || []
  }),
  mutations: {
    SET_LOCATION(state, data) {
      state.location = data;
      setCache('location', state.location);
    },
    SET_CATEGORIES(state, data) {
      state.categories = data
      setCache('categories', state.categories);
    }
  },
  actions: {},
};
