Send events
Sender
import { WebComponentEventBus, ALL, ALL_TYPES } from '@manufosela/event-bus-webcomponent';
const bus = new WebComponentEventBus();
bus.on({ id: 'card-b', type: 'demo-card' }, (envelope) => {
console.log(envelope.name, envelope.detail);
});
bus.emit({
name: 'ping',
detail: { ok: true },
source: { id: 'card-a', type: 'demo-card' },
target: { id: ALL, type: ALL_TYPES, excludeSource: true }
});