// SHAMELESS THEFT: https://github.com/EvanAgee/vuejs-wordpress-theme-starter import Vuex from 'vuex' import * as actions from './actions' import * as getters from './getters' import page from './modules/page' import post from './modules/post' import artist from './modules/artist' import episode from './modules/episode' const debug = process.env.NODE_ENV !== 'production' // Vue.config.devtools = true // Current page state const state = { title: wp.site_name, hero: { url: 'http://sample-image-url/', text: 'sample hero text', playbutton: true }, view: 'list' } const mutations = { SET_HERO(state, hero) { if (hero.url) { state.hero.text = state.hero.url = hero.url } else { state.hero.text = hero } }, } const store = new Vuex.Store({ actions, getters, mutations, state, modules: { post, page, artist, episode }, strict: debug, }) export default store