This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useEffect, useRef, FunctionComponent, HTMLProps } from 'react'; | |
| import 'intersection-observer'; // if you want to include a polyfill | |
| /** | |
| * Returns an IntersectionObserver that loads the image | |
| * when it is at least {threshold}*100 visible in the viewport. | |
| * | |
| * PS: Cached on the window for performance | |
| */ | |
| function getImageLoaderObserver( |