You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
822 B

import { createLogger, createStore } from "vuex";
import { GenericStore } from "./generics";
import { getters, GettersTypes } from "./getters";
// Import store information
import { state, IState } from "./state";
import { mutations, MutationsTypes } from "./mutations";
import { actions, ActionsTypes } from "./actions";
// Export store keys
export { Mutation } from "./mutations";
export { Action } from "./actions";
/**
* The the store type
*/
export type Store = GenericStore<IState, GettersTypes, MutationsTypes, ActionsTypes>;
/**
* Create the store instance
*/
const store = createStore({
state, getters, mutations, actions, plugins: [createLogger()]
}) as Store;
/**
* Use the store
*/
export function useStore() {
return store;
}
/**
* Export the store instance by default
*/
export default store;