4 answers
Ok, so in the face of component event which one is better to use components event or aura:method ? and what about performance difference? Hi Artur,
- Component Events can only be handled by components and the communication will be simple between components. Salesforce recommends using Component events instead of application events. The component events can only be registered in child component and handled by parent-component.
- http://www.mstsolutions.com/blog/content/salesforce-lightning-events
- https://www.sundoginteractive.com/blog/understanding-lightning-component-events
- https://sfdcpanther.wordpress.com/2017/12/07/play-with-events-in-lightning-component-part-2/
Please mark it as best answer if the information is informative.
ThanksRahul KumarThank's Rahul I have seen this before but there isn't information about component events... Hi Artur,
- Application events are really expensive.As a best practice, it's recommended to avoid them unless you need them badly. It's reserved for something that's needed across the application.
- aura: method is a great alternative.It keeps code readable and maintainable and there is less code needed.
please refer the below link for reference.
hope it helps.
Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.ThanksRahul Kumar