feat: install emitter as a plugin

This commit is contained in:
Shivam Mishra
2024-08-05 11:54:29 +05:30
parent 2a8d7e55c6
commit 523769b7ed
5 changed files with 16 additions and 9 deletions
+8 -1
View File
@@ -1,3 +1,10 @@
import mitt from 'mitt';
const emitter = mitt();
export { emitter };
const EmitterPlugin = {
install(Vue) {
Vue.prototype.$emitter = emitter;
},
};
export { emitter, EmitterPlugin };