28 lines
544 B
TypeScript
28 lines
544 B
TypeScript
import Vue from "vue";
|
|
import Vuex, { MutationTree, ActionTree, GetterTree } from "vuex";
|
|
import { AppState } from "./types";
|
|
|
|
Vue.use(Vuex);
|
|
|
|
const state: AppState = {
|
|
players: [
|
|
{ name: "Player 1", points: 0, at: 0 },
|
|
{ name: "Player 2", points: 0, at: 0 }
|
|
]
|
|
};
|
|
|
|
const mutations: MutationTree<AppState> = {};
|
|
|
|
const actions: ActionTree<AppState, AppState> = {};
|
|
|
|
const getters: GetterTree<AppState, AppState> = {
|
|
players: state => state.players
|
|
};
|
|
|
|
export default new Vuex.Store({
|
|
state,
|
|
mutations,
|
|
actions,
|
|
getters
|
|
});
|