Skip to content

Events for async callback in Admin UI

In you C# class, issue an event by calling the static method:

var arg1 = "String me up Scotty!";
var arg2 = [1, 2, 3, 4 ,5];
BongoEvents.Fire(BongoEvents.BongoExampleEvent, arg1, arg2);

The BongoExampleEvent is nothing but a simple string. Please make it a habit to declare it as a const. The arguments can be any number of different values.

In a UI component or page, add a listener withing the sockets property.

{
...restOfComponent,
sockets: {
BongoExampleEvent([arg1, arg2]) {
for(let num of arg2) {
console.log(`Guy ${num} said: ${arg1}`)
}
}
}
}