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

25 lines
385 B
TypeScript
Raw Normal View History

2019-06-06 14:07:36 +00:00
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);