aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/plugins/vuex.ts
blob: 9b2fa469cad301a52c79cfc7bea7a9c013d8b459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Vue from 'vue'
import Vuex from 'vuex'
import { extractVuexModule } from "vuex-class-component";
import { createProxy } from "vuex-class-component";
import UIStore from '@/store/uiStore';

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    ...extractVuexModule(UIStore)
  }
});

Vue.use((vue) => vue.prototype.$uiStore = createProxy(store, UIStore));

declare module 'vue/types/vue' {
  interface Vue {
    $uiStore: UIStore
  }
}

export default store;