Lib: Add comment to lazyload.ts
This commit is contained in:
@ -14,7 +14,12 @@ const getObserver = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is used as an action on lazyloaded elements
|
/**
|
||||||
|
* Use this as an action on elements that should be only loaded when moved into view.
|
||||||
|
* Note that if the element's size is 0 on mount, multiple elements could be in-view that
|
||||||
|
* would be out-of-view with their correct size.
|
||||||
|
* This happens for <div> elements without content for example.
|
||||||
|
*/
|
||||||
export const lazyload = (node: HTMLElement) => {
|
export const lazyload = (node: HTMLElement) => {
|
||||||
// The observer determines if the element is visible on screen
|
// The observer determines if the element is visible on screen
|
||||||
getObserver();
|
getObserver();
|
||||||
|
|||||||
Reference in New Issue
Block a user