primevue-mirror/components/usetoast/UseToast.js

12 lines
278 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);
if (!PrimeVueToast) {
throw new Error('No PrimeVue Toast provided!');
}
return PrimeVueToast;
}