Activity Forums Salesforce® Discussions When should we use Component event and application events?

  • shariq

    Member
    September 23, 2018 at 10:43 pm

    It is best to always use a component event instead of an application event. Component events can only be handled by components above them in the containment hierarchy, therefore, their usage is localized to the components that need to know about them.

    Application events are best used for something that should be handled at the application level, such as navigating to a specific record. Application events allow communication between components that are in separate parts of the application and have no direct containment relationship.

  • Parul

    Member
    September 28, 2018 at 8:55 pm

    Addin some more points:

    Application Events vs Component Events : Which/How to use for handling custom events in Lightning. Lightning framework is based on event-driven architecture which allows to communicate between different events. Lightning events can be fired or handled by javascript controller.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos