primevue-mirror/components/usetoast/UseToast.js

12 lines
278 B
JavaScript

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;
}