mirror of
https://github.com/mue/mue.git
synced 2026-07-09 13:35:35 +02:00
feat: hot reload support for some widgets, css improvements on marketplace
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
17
src/modules/helpers/eventbus.js
Normal file
17
src/modules/helpers/eventbus.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const EventBus = {
|
||||
on(event, callback) {
|
||||
document.addEventListener(event, (e) => callback(e.detail));
|
||||
},
|
||||
|
||||
dispatch(event, data) {
|
||||
document.dispatchEvent(new CustomEvent(event, {
|
||||
detail: data
|
||||
}));
|
||||
},
|
||||
|
||||
remove(event, callback) {
|
||||
document.removeEventListener(event, callback);
|
||||
},
|
||||
};
|
||||
|
||||
export default EventBus;
|
||||
Reference in New Issue
Block a user