Files
api/store/errors.ts
2023-08-08 13:50:42 -07:00

31 lines
891 B
TypeScript

import { defineStore, createPinia, setActivePinia } from 'pinia';
// import { useAccountStore } from './account';
// import { useCallbackStore } from './callbackActions';
// import { useInstallKeyStore } from './installKey';
// import { useServerStore } from './server';
/**
* @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components
* @see https://github.com/vuejs/pinia/discussions/1085
*/
setActivePinia(createPinia());
export const useErrorsStore = defineStore('errors', () => {
// const accountStore = useAccountStore();
// const callbackStore = useCallbackStore();
// const installKeyStore = useInstallKeyStore();
// const serverStore = useServerStore();
/** @todo type the errors */
const errors = ref<any[]>([]);
const setError = (error: any) => {
errors.value.push(error);
};
return {
errors,
setError,
};
});