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 { createCustomElement, getEventBus, withEventBus } from 'https://cdn.skypack.dev/ficusjs@6'
// use it within a component
createCustomElement(
'my-component',
withEventBus(getEventBus(), {
/* pass component creation options here */
})
)