Allow custom data when emitting events.

Custom data can be included by setting that type
when instantiating the template.