DocsReal-TimeEvent BusReal-TimeEvent BusIn-process publish/subscribe with wildcards.1 min readDocumentationEdit this pageUsage# typescriptimport { EventBus } from '@axiljs/events' const bus = new EventBus() bus.on('user.created', async (event) => { console.log(event.payload) }) await bus.emit('user.created', { id: 1 }) Wildcards# typescriptbus.on('user.*', handler) // user.created, user.deleted bus.on('*', handler) // everything One-time and wait# typescriptbus.once('payment.confirmed', handler) const event = await bus.waitFor('payment.confirmed', 5000) Decorators# typescriptimport { OnEvent, registerEventHandlers } from '@axiljs/events' class Notifications { @OnEvent('user.created') async sendWelcome(event) { await sendEmail(event.payload.email) } } registerEventHandlers(new Notifications(), bus)PreviousHTTP ClientNextWebSockets