react-intersection-observer-hook
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,2 +0,2 @@ | ||
"use strict";var r=require("react"),e=null,t="0px",n=[0];function o(o){var i=void 0===o?{}:o,s=i.root,c=void 0===s?e:s,u=i.rootMargin,a=void 0===u?t:u,v=i.threshold,f=void 0===v?n:v,l=r.useRef(),d=r.useState(),b=d[0],h=d[1];return r.useEffect((function(){return function(){var r=l.current;r&&r.disconnect()}}),[]),[r.useCallback((function(r){var e=(l.current||(l.current=new IntersectionObserver((function(r){h(r[0])}),{root:c,rootMargin:a,threshold:f})),l.current);e.disconnect(),r&&e.observe(r)}),[c,a,f]),{entry:b}]}exports.useIntersectionObserver=o,exports.useTrackVisibility=function(r){var e=o(r),t=e[1].entry;return[e[0],{isVisible:Boolean(t&&t.isIntersecting)}]}; | ||
"use strict";var r=require("react"),e=[0];function t(t){var n=void 0===t?{}:t,o=n.root,i=void 0===o?null:o,s=n.rootMargin,c=void 0===s?"0px":s,u=n.threshold,a=void 0===u?e:u,v=r.useRef(),f=r.useState(),l=f[0],d=f[1];return r.useEffect((function(){return function(){var r=v.current;r&&r.disconnect()}}),[]),[r.useCallback((function(r){var e=(v.current||(v.current=new IntersectionObserver((function(r){d(r[0])}),{root:i,rootMargin:c,threshold:a})),v.current);e.disconnect(),r&&e.observe(r)}),[i,c,a]),{entry:l}]}exports.useIntersectionObserver=t,exports.useTrackVisibility=function(r){var e=t(r),n=e[1].entry;return[e[0],{isVisible:Boolean(n&&n.isIntersecting)}]}; | ||
//# sourceMappingURL=react-intersection-observer-hook.cjs.production.min.js.map |
{ | ||
"name": "react-intersection-observer-hook", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "onderonur", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22854