芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/vendor/livewire/livewire/js/MessageBus.js
export default class MessageBus { constructor() { this.listeners = {} } register(name, callback) { if (! this.listeners[name]) { this.listeners[name] = [] } this.listeners[name].push(callback) } call(name, ...params) { (this.listeners[name] || []).forEach(callback => { callback(...params) }) } has(name) { return Object.keys(this.listeners).includes(name) } }