Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

SimpleEventBus is a global variable for the event streamclass for managing the flow of the events. See the Global Client Events article for more information on about the usage of these methodssystem out-of-the-box events that the class can interact with.

on(eventType, callback)


A subscription Use this method to subscribe to an event. 

Parameters:

NameTypeMandatoryDefault Value
eventTypeStringYN
callbackcallbackFunctionYN

Return:

TypeDescription
ObjectContains the unsubscribe methodAn object containing a method to unsubscribe from the event.

Example:

Code Block
languagejs
titleon
linenumberstrue
const obj = SimpleEventBus.on('myEvent', (data) => { alert(data); }) 
obj.unsubscribe();

emit(eventType, data)


This method starts an event. Use it Use this method in client scripts of the widgetsor widgets to initiate an event.

Parameters:

NameTypeMandatoryDefault Value
eventTypeStringYN
dataAnyNN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

Code Block
languagejs
titleemit
linenumberstrue
const obj = SimpleEventBus.emit('myEvent', 'text')


deleteEvent(eventType)


Deletes Use this method to delete an event.

Parameter:

NameTypeMandatoryDefault Value
eventTypeStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

Code Block
languagejs
titledeleteEvent
linenumberstrue
const obj = SimpleEventBus.deleteEvent('myEvent')


reset()


This method resets all events and subscriptions.
Return:

TypeDescription
VoidThis method does not return a value.

Example:

Code Block
languagejs
titledeleteEvent
linenumberstrue
SimpleEventBus.reset()





Table of Contents
classfixedPosition