Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
SimpleEventBus is a global variable for the event stream. See Global Client Events for more information on the usage of these methods.
on(eventType, callback)
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:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
const obj = SimpleEventBus.on('myEvent', (data) => { alert(data); }) obj.unsubscribe(); |
emit(eventType, data)
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:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
const obj = SimpleEventBus.emit('myEvent', 'text') |
deleteEvent(eventType)
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:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
const obj = SimpleEventBus.deleteEvent('myEvent') |
reset()
This methos method resets all events and subscriptions.
Return:
Type | Description |
---|---|
Void | This method does not return a value. |
Example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
SimpleEventBus.reset() |
Table of Contents | ||
---|---|---|
|