WebIndex/plugins/mitt.ts

19 lines
272 B
TypeScript
Raw Normal View History

2024-12-18 08:42:00 +08:00
import mitt from 'mitt'
type Events = {
openPost: IPost
startLoading: boolean
eventBus: INotification
}
export default defineNuxtPlugin(() => {
const emitter = mitt<Events>()
return {
provide: {
mitt: emitter
}
}
})