UNPKG

react-component-lazy-loader

Version:

A package which lazily loads it's children components based on viewport visibility of the component. Useful in lazyloading images or any other custom component.

15 lines (13 loc) 499 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var isIntersectionObserverSupported = exports.isIntersectionObserverSupported = function isIntersectionObserverSupported() { return typeof window !== 'undefined' && 'IntersectionObserver' in window; }; var currentScrollPosition = exports.currentScrollPosition = function currentScrollPosition() { return { scrollX: window.scrollX || window.pageXOffset, scrollY: window.scrollY || window.pageYOffset }; };