Upon reading this question I wondered if it is really needed to extend CustomEvent if you want to have custom DOM events in your application. Would it be possible to just extend Event or does CustomEvent serve a special purpose for technical reasons?
An example I was thinking of: a login component with 2 properties "username" and "password". I can imagine a LoginEvent with those two properties. I could either:
- have the two properties as properties of the event class, in which case I don't need/use the detail of CustomEvent and hence may not need to extend CustomEvent.
- pass them in as an array to the detail property of CustomEvent.
- create a LoginParams object with the two properties and pass this in to the detail property of CustomEvent.