14 lines
279 B
JavaScript
14 lines
279 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;
|
||
|
}
|