I can\'t find a way to create custom events with scala-js. For instance, with js you can create a custom event like the following (taken from here):
var event
If you want to stay in the typed DOM (assuming you are talking about the scala-js-dom library), you can do:
new CustomEvent().initCustomEvent('build', false, false, elem.dataset.time)
The constructor you are using is actually only specified in DOM 4 (see MDN).