station.js 555 B

12345678910111213141516171819202122232425262728293031323334
  1. /* eslint no-param-reassign: 0 */
  2. const state = {
  3. station: {},
  4. editing: {}
  5. };
  6. const getters = {};
  7. const actions = {
  8. joinStation: ({ commit }, station) => {
  9. commit("joinStation", station);
  10. },
  11. editStation: ({ commit }, station) => {
  12. commit("editStation", station);
  13. }
  14. };
  15. const mutations = {
  16. joinStation(state, station) {
  17. state.station = { ...station };
  18. },
  19. editStation(state, station) {
  20. state.editing = { ...station };
  21. }
  22. };
  23. export default {
  24. namespaced: true,
  25. state,
  26. getters,
  27. actions,
  28. mutations
  29. };