Salesforce Lightning Component – Application Event
In continuation to my previous post about component event in Salesforce Lightning, today I would like to discuss about the another type of event i.e. Application event.Application event in Salesforce Lightning follows publish-subscribe model. An application is fired from an instance of a component. All components that provide a handler for the event will be notified once the event is fired. Below diagram will give you a more clear picture -As the above diagram tells – Component 1 is firing the event and that information is getting passed to Salesforce framework. Now all the events – Component 2, 3, 4 & 5 are already registered as handler of this event. So it is now Salesforce framework who will notify all these components that the event has occurred. Here you can see that all the components are very much loosely coupled because when Component 1 is firing the event, it does not know or rather it does not care which component is going to handle that event. Similarly when Component 2 or 3 or 4 or 5 will get notified that the event has occurred, they really don’t know which component has fired the event. This approach makes that component very much loosely coupled.Now I will start with few basic and later I will give you an example to understand Application event.CREATE CUSTOM APPLICATION EVENT:To create Application event, you need...
Read More