SimpleEventBus is a global variable for the event stream. See Global Client Events for more information on the usage of these methods.
A subscription to an event.
Parameters:
Name | Type | Mandatory | Default Value |
---|---|---|---|
eventType | String | Y | N |
callback | callback | Y | N |
Return:
Type | Description |
---|---|
Object | Contains the unsubscribe method. |
Example:
const obj = SimpleEventBus.on('myEvent', (data) => { alert(data); }) obj.unsubscribe(); |
This method starts an event. Use it in client scripts of the widgets.
Parameters:
Name | Type | Mandatory | Default Value |
---|---|---|---|
eventType | String | Y | N |
data | Any | N | N |
Return:
Type | Description |
---|---|
Void | This method does not return a value. |
Example:
const obj = SimpleEventBus.emit('myEvent', 'text') |
Deletes an event.
Parameter:
Name | Type | Mandatory | Default Value |
---|---|---|---|
eventType | String | Y | N |
Return:
Type | Description |
---|---|
Void | This method does not return a value. |
Example:
const obj = SimpleEventBus.deleteEvent('myEvent') |
This method resets all events and subscriptions.
Return:
Type | Description |
---|---|
Void | This method does not return a value. |
Example:
SimpleEventBus.reset() |