git.fiddlerwoaroof.com
src/main.js
4437840d
 import Vue from 'vue';
 import Vuex from 'vuex';
 import App from './App.vue';
8320b1e7
 import createPersistedState from 'vuex-persistedstate'
4437840d
 Vue.use(Vuex);
 
 new Vue({
     el: '#app',
     render: h => h(App),
     store: new Vuex.Store({
8320b1e7
 	plugins: [
 	    createPersistedState()
 	],
4437840d
 	state: {
 	    times: []
 	},
 	mutations: {
 	    add ({times}) {
 		times.push({id: times.length, time: new Date(), annotations: []});
 	    },
 
 	    annotate({times}, {idx, annotation}) {
 		times[idx].annotations.unshift({time: new Date(), text: annotation});
d77a13db
 	    },
 
 	    reset(state) {
 		state.times = [];
 	    },
4437840d
 	}
     })
 })