Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Models are getting instantiated twice for every component on page when datalayer is turned on #17

Open
mmange opened this issue Jun 11, 2020 · 0 comments

Comments

@mmange
Copy link

mmange commented Jun 11, 2020

First of all this is a great library thanks for sharing @klcodanr

As I was trying out this library, I noticed that when I turned on the datalayer for a page, the Models were getting instantiated twice:

  1. By the component's sightly
    2.By the datalayer

Looking at the code in the interceptor filter this seems expected as the updateDataLayer instantiates the models for resources on page. But, this does have some performance implications if the page contains models whose initialization costs are expensive (for e.g. lists that run queries etc.). Any ideas to avoid this besides turning on caching on Models (which I haven't tried yet but, something I was contemplating doing to see if it helps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant