2025-03-10 21:27:03 -04:00

21 lines
409 B
TypeScript

import {defineStore} from "pinia";
import {ref} from "vue";
export const useErrorStore = defineStore('error', () => {
/** @type {(string[])} */
const errors = ref([] as any[])
function unshift(error: string) {
console.error('Error:', error);
errors.value.unshift(error)
}
function getErrors() {
return errors
}
return { errors, getErrors, unshift}
})