-
Notifications
You must be signed in to change notification settings - Fork 943
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
Improve listingpage lazy loading #871
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the comments, otherwise good to go 👍
@@ -106,8 +110,8 @@ export const lazyLoadWithDimensions = (Component, options) => { | |||
window.addEventListener('orientationchange', this.handleWindowResize); | |||
|
|||
this.defaultRenderTimeout = window.setTimeout(() => { | |||
if (this.isElementInViewport()) { | |||
this.handleWindowResize(); | |||
if (this.isElementNearViewport(0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isElementNearViewport
doesn't seem to take a param.
@@ -120,7 +124,9 @@ export const lazyLoadWithDimensions = (Component, options) => { | |||
} | |||
|
|||
handleWindowResize() { | |||
this.setDimensions(); | |||
if (this.isElementNearViewport(NEAR_VIEWPORT_MARGIN)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isElementNearViewport
doesn't seem to take a param, but it uses NEAR_VIEWPORT_MARGIN
internally.
3a5fa17
to
ab81987
Compare
No description provided.