Implement first version of onCustomEventHandler
Expand on function documentation