resources.js
1 import A from '../actions.js' 2 3 const state = [] // aka resources (in this file): 4 5 const mutations = { 6 setCurrent(resources, current){ 7 resources.length = 0 8 current.resources.forEach( resource => { 9 resources.push(resource) 10 }) 11 }, 12 applyEvent: A.resourcesActions 13 } 14 15 const actions = {} 16 17 export default { 18 state, 19 mutations, 20 actions, 21 }