How to handle global notifications?
I'd like to show a notification component whenever an event (like an API response) is triggered on any page. Right now I have to include the component on each page separately because there doesn't seem to be a way to listen to events on the layout itself. I've found several solutions for Nuxt 2 (like $nuxt.$emit => $nuxt.$on) but none of them work with Nuxt 3. I've also tried implementing Mitt (https://github.com/developit/mitt) but Nuxt 3 doesn't like that one either.
Is there maybe some other way how to achieve this?
Is there maybe some other way how to achieve this?
GitHub
Tiny 200 byte functional event emitter / pubsub. - GitHub - developit/mitt:
Tiny 200 byte functional event emitter / pubsub.
