Events strategy for performance and ease of code maintenance

Application events can take significant performance. Hence, it is recommended that if you need to communicate between two components that follow a hierarchy and there is no business need to couple the components loosely, use a component event instead of an application event.

Also, as a rule of best practice, use only one component event throughout the application. For additional details, refer to the Advanced Event Architecture section in Chapter 5, Events in the Lightning Component Framework.

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.