import { createStore } from "framework7/lite";

const store = createStore({
  state: {
    radios: {
      "https://www.ondarossa.info": {
        name: "ROR",
      },
      "https://radiospore.oziosi.org": {
        name: "Spore",
      },
    },
  },
  getters: {
    radios({state}) {
      return state.radios
    },
  },
  actions: {
    cambia({state}, {base }) {
      const oneRadio = Object.keys(state.radios)[0]
      const prevValue = state.radios[oneRadio].name
      state.radios[oneRadio].name = prevValue.split(" ")[0] + " " + (base+Math.random())
    }
},
});
export default store;
