Comparing version 2.1.5 to 2.1.6
@@ -234,11 +234,6 @@ 'use strict' | ||
const fps = | ||
const scrollY = (0, _windowScroll.default)( | ||
((_options$scroll = options.scroll) === null || _options$scroll === void 0 | ||
? void 0 | ||
: _options$scroll.fps) || 8 | ||
const scrollY = (0, _windowScroll.default)(fps) | ||
const [width, height] = (0, _windowSize.default)( | ||
initialWidth, | ||
initialHeight, | ||
options.size || defaultSizeOpt | ||
) | ||
@@ -250,3 +245,7 @@ | ||
const isScrolling = _ref_0[0] | ||
const isScrollingTimeout = useRef() | ||
const [width, height] = (0, _windowSize.default)( | ||
initialWidth, | ||
initialHeight, | ||
options.size || defaultSizeOpt | ||
) | ||
@@ -257,19 +256,9 @@ function _ref() { | ||
setIsScrolling(false) | ||
isScrollingTimeout.current = void 0 | ||
} | ||
;(0, _passiveLayoutEffect.default)(() => { | ||
if (isScrollingTimeout.current !== null) { | ||
clearTimeout(isScrollingTimeout.current) | ||
isScrollingTimeout.current = void 0 | ||
} | ||
setIsScrolling(true) | ||
isScrollingTimeout.current = window.setTimeout(_ref, 1000 / 6) | ||
}, [scrollY]) // cleans up isScrollingTimeout on unmount | ||
useEffect(() => { | ||
const to = isScrollingTimeout.current | ||
return () => to !== void 0 && window.clearTimeout(to) | ||
}, emptyArr) | ||
if (!isScrolling) setIsScrolling(true) | ||
const to = window.setTimeout(_ref, 1000 / 6) | ||
return () => window.clearTimeout(to) | ||
}, [scrollY]) | ||
return { | ||
@@ -276,0 +265,0 @@ width, |
@@ -208,11 +208,6 @@ import _pt from 'prop-types' | ||
const fps = | ||
const scrollY = useWindowScroll( | ||
((_options$scroll = options.scroll) === null || _options$scroll === void 0 | ||
? void 0 | ||
: _options$scroll.fps) || 8 | ||
const scrollY = useWindowScroll(fps) | ||
const [width, height] = useWindowSize( | ||
initialWidth, | ||
initialHeight, | ||
options.size || defaultSizeOpt | ||
) | ||
@@ -224,3 +219,7 @@ | ||
const isScrolling = _ref_0[0] | ||
const isScrollingTimeout = useRef() | ||
const [width, height] = useWindowSize( | ||
initialWidth, | ||
initialHeight, | ||
options.size || defaultSizeOpt | ||
) | ||
@@ -231,19 +230,9 @@ function _ref() { | ||
setIsScrolling(false) | ||
isScrollingTimeout.current = void 0 | ||
} | ||
useLayoutEffect(() => { | ||
if (isScrollingTimeout.current !== null) { | ||
clearTimeout(isScrollingTimeout.current) | ||
isScrollingTimeout.current = void 0 | ||
} | ||
setIsScrolling(true) | ||
isScrollingTimeout.current = window.setTimeout(_ref, 1000 / 6) | ||
}, [scrollY]) // cleans up isScrollingTimeout on unmount | ||
useEffect(() => { | ||
const to = isScrollingTimeout.current | ||
return () => to !== void 0 && window.clearTimeout(to) | ||
}, emptyArr) | ||
if (!isScrolling) setIsScrolling(true) | ||
const to = window.setTimeout(_ref, 1000 / 6) | ||
return () => window.clearTimeout(to) | ||
}, [scrollY]) | ||
return { | ||
@@ -250,0 +239,0 @@ width, |
{ | ||
"name": "masonic", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"homepage": "https://github.com/jaredLunde/masonic#readme", | ||
@@ -5,0 +5,0 @@ "repository": "github:jaredLunde/masonic", |
@@ -20,4 +20,4 @@ <hr> | ||
--> | ||
<a aria-label="Build status" href="https://travis-ci.org/jaredLunde/masonic"> | ||
<img alt="Build status" src="https://img.shields.io/travis/jaredLunde/masonic?style=for-the-badge&labelColor=24292e"> | ||
<a aria-label="Build status" href="https://travis-ci.com/jaredLunde/masonic"> | ||
<img alt="Build status" src="https://img.shields.io/travis/com/jaredLunde/masonic?style=for-the-badge&labelColor=24292e"> | ||
</a> | ||
@@ -24,0 +24,0 @@ <a aria-label="NPM version" href="https://www.npmjs.com/package/masonic"> |
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
113689
2528