createEventBus function

Once you have created your events instance using createEventBus, simply pass it to each component:

import { createCustomElement, createEventBus, withEventBus } from 'https://cdn.skypack.dev/ficusjs@6'

// create the event bus
const eventBus = createEventBus()

// create a new component
createCustomElement(
  'my-component',
  withEventBus(eventBus, {
    /* pass component creation options here */
  })
)