// Emit the event named "hello"
myEntity.emit('hello');
// Emit the event named "hello"
myEntity.emit('hello', {moo: true});
// Emit the event named "hello"
myEntity.emit('hello', [{moo: true}, 'someString']);
// Set a listener to listen for the data (multiple values emitted
// from an event are passed as function arguments)
myEntity.on('hello', function (arg1, arg2) {
console.log(arg1, arg2);
}
// Emit the event named "hello"
myEntity.emit('hello', ['data1', 'data2']);
// The console output is:
// data1, data2