chore: Replace eventBus with mitt.js

This commit is contained in:
Fayaz Ahmed
2024-05-13 14:23:13 +05:30
parent 9a8442fe0e
commit eeb17cd27c
4 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import Vue from 'vue';
import VueI18n from 'vue-i18n';
import VueRouter from 'vue-router';
import axios from 'axios';
import bus from './mitt.js';
// Global Components
import hljs from 'highlight.js';
import Multiselect from 'vue-multiselect';
@@ -93,7 +94,7 @@ commonHelpers();
window.WootConstants = constants;
window.axios = createAxios(axios);
window.bus = new Vue();
window.bus = bus;
initializeChatwootEvents();
initializeAnalyticsEvents();
initalizeRouter();
+11
View File
@@ -0,0 +1,11 @@
import mitt from 'mitt';
const emitter = mitt();
const bus = {
$on: emitter.on,
$off: emitter.off,
$emit: emitter.emit,
};
export default bus;