Files
SolidScribe/v2client-vite-vue3/src/EventBus.js
T

13 lines
295 B
JavaScript

import mitt from 'mitt'
const emitter = mitt()
// Preserves the Vue 2 $on/$emit/$off API used throughout the codebase
const EventBus = {
$on: (...args) => emitter.on(...args),
$off: (...args) => emitter.off(...args),
$emit: (...args) => emitter.emit(...args),
}
export default EventBus