omphalos.event.raise
function omphalos.event.raise(event, data)Send a named event message to all assets in the current bundle; data can be
any desired value, so long as it is JSON-encodeable.
To send a message to items in a different bundle, use
omphalos.event.raiseToBundle() instead.
The message will be transmitted to all graphic,
panel and extension listeners in the
current bundle, except for the sender, and can be listened for via
omphalos.event.on().
// Listen for an event in the current bundleconst unlisten = omphalos.event.on('my-event', (payload) => { omphalos.log.info(`Got event with data: ${payload.some}`);});
// Listen for an event from a specific external bundleconst unlistenExt = omphalos.event.on('their-event', 'other-bundle', (payload) => { omphalos.log.info(`Got external event with data: ${payload.some}`);});
// Raise an event to peers in the current bundleomphalos.event.raise('my-event', { some: 'data' });
// Raise an event to peers in a specific external bundleomphalos.event.raiseToBundle('their-event', 'other-bundle', { some: 'data' });