primevue-mirror/components/lib/usetoast/UseToast.js

14 lines
279 B
JavaScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { inject } from 'vue';
export const PrimeVueToastSymbol = Symbol();
export function useToast() {
const PrimeVueToast = inject(PrimeVueToastSymbol);
2022-09-14 11:26:01 +00:00
2022-09-06 12:03:37 +00:00
if (!PrimeVueToast) {
throw new Error('No PrimeVue Toast provided!');
2022-09-14 11:26:01 +00:00
}
2022-09-06 12:03:37 +00:00
return PrimeVueToast;
2022-09-14 11:26:01 +00:00
}