Activity Forums Salesforce® Discussions How do you implement lazy loading in lightning component in Salesforce?

  • Deepak

    Member
    February 10, 2020 at 6:07 am

    Hi Ratnesh,

    Best ways to implement lazy loading are as follows:

    1.Dynamically create component when parent component's initialisation is completed.

    2.Create/query data when a particular event triggers.

    3.Use AfterRender - This one is quite interesting, and can also achieve the required outcome. However if I have to trigger an event as part of this initialisation, Salesforce discourages to do that, as it results in a chain reaction.
    4.By adding a timer in controller function to delay component data loading
    Hope it helps!

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos