getEventBus function #

The getEventBus function is a quick way to retrieve the events instance.
If the event bus has not yet been created, getEventBus will create a new instance automatically.

// import the function
import { createComponent, getEventBus, withEventBus } from 'https://cdn.skypack.dev/ficusjs@3'

// use it within a component
createComponent(
'my-component',
withEventBus(getEventBus(), {
/* pass component creation options here */
})
)