WebIndex/plugins/mitt.ts
2025-01-13 23:12:06 +08:00

18 lines
250 B
TypeScript

import mitt from 'mitt'
interface Events {
openPost: IPost
startLoading: boolean
eventBus: INotification
}
export default defineNuxtPlugin(() => {
const emitter = mitt<Events>()
return {
provide: {
mitt: emitter,
},
}
})