Skip to content

Instantly share code, notes, and snippets.

@mtermoul
Last active July 27, 2018 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtermoul/5996cf4e08f7e33876aaa31f50c468d0 to your computer and use it in GitHub Desktop.
Save mtermoul/5996cf4e08f7e33876aaa31f50c468d0 to your computer and use it in GitHub Desktop.
store-locator state management with vuex
import Vue from 'vue'
import Vuex from 'vuex'
import VueResource from 'vue-resource'
import Cosmic from '../api/cosmic'
Vue.use(Vuex)
Vue.use(VueResource)
export default new Vuex.Store({
state: {
userLocation: {},
selectedLocation: {},
selectedStore: null,
availableLocations: {},
stores: []
},
getters: {
...
},
mutations: {
...
},
actions: {
...
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment