mlp-server-tools/webclient/src/store.ts

24 lines
385 B
TypeScript

import Vue from "vue";
import Vuex, { StoreOptions } from "vuex";
Vue.use(Vuex);
export interface AppState {
in_room: boolean;
room: string;
playerName: string;
}
const store: StoreOptions<AppState> = {
state: {
in_room: false,
room: "",
playerName:
"webclient-" +
Math.random()
.toString(32)
.slice(2)
}
};
export default new Vuex.Store<AppState>(store);