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

Allow 'eager-loading` cells. #7

Open
danelowe opened this issue Aug 5, 2015 · 0 comments
Open

Allow 'eager-loading` cells. #7

danelowe opened this issue Aug 5, 2015 · 0 comments

Comments

@danelowe
Copy link
Owner

danelowe commented Aug 5, 2015

At the moment, cells are instantiated lazily, i.e. only when needed to render. This suits most simple cases, when we might want to construct the cell with specific parameters at the time of rendering.

However, in more complex cases, if the constructor of one cell needed to adjust cells elsewhere in the layout, e.g. add Javascript to the head, or adjust the breadcrumbs/navigation, it makes sense to have all of the cells instantiated as soon as the layout is loaded, and adjust each before rendering using methods rather than constructor arguments.

E.g. when the product details cell is instantiated, it adds the zoom javascript to the head cell, and adds a path to the breadcrumbs cell. This happens when the layout is loaded, so that by the time the head cell is rendered, it has all of the details it need.s

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