Adding a high number of component events and application events can not only add more files to your project but can also make debugging your application more difficult.
Keep it simple by using the following patterns:
- Use only one component file throughout the application. The component event has the attribute name, where can define different names. This will enable us to distinguish them without creating a separate file for each component event. To further understand this, let's take a look at the following code snippet, as an example that defines a component event. Let's name the event file genericEvt:
<aura:event type="COMPONENT" description="Generic Component Event" > <aura:attribute name="cmpData" ...