Versions Compared

Key

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

SimpleEventBus is a global variable for the event stream. See This class provides methods 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 Valuevalue
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 Valuevalue
eventTypeStringYN
dataAnyNN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

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

deleteEvent(eventType)


Deletes Use this method to delete an event.

Parameter:

NameTypeMandatoryDefault Valuevalue
eventTypeStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

Code Block
linenumbers
languagejs
titledeleteEvent()true
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
titledeleteEventlinenumberstruereset()
SimpleEventBus.reset()


Table of Contents
classfixedPosition