@shopify/react-intersection-observer
Advanced tools
Comparing version 1.0.0-sknext-beta.1 to 1.0.0-sknext-beta.2
"use strict"; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useValueTracking = exports.useIntersection = void 0; | ||
var tslib_1 = require("tslib"); | ||
/* eslint-disable react-hooks/exhaustive-deps */ | ||
@@ -26,3 +41,3 @@ var react_1 = require("react"); | ||
var lastObserver = react_1.useRef(null); | ||
var _d = tslib_1.__read(react_1.useState(function () { return ({ | ||
var _d = __read(react_1.useState(function () { return ({ | ||
boundingClientRect: emptyBoundingClientRect, | ||
@@ -42,3 +57,3 @@ intersectionRatio: 0, | ||
var intersectionObserver = new IntersectionObserver(function (_a) { | ||
var _b = tslib_1.__read(_a, 1), entry = _b[0]; | ||
var _b = __read(_a, 1), entry = _b[0]; | ||
return setIntersectingEntry(entry); | ||
@@ -45,0 +60,0 @@ }, { |
"use strict"; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.IntersectionObserver = void 0; | ||
var tslib_1 = require("tslib"); | ||
var react_1 = tslib_1.__importDefault(require("react")); | ||
var react_1 = __importDefault(require("react")); | ||
var hooks_1 = require("./hooks"); | ||
exports.IntersectionObserver = react_1.default.memo(function IntersectionObserver(_a) { | ||
var children = _a.children, root = _a.root, rootMargin = _a.rootMargin, threshold = _a.threshold, unsupportedBehavior = _a.unsupportedBehavior, _b = _a.wrapperComponent, Wrapper = _b === void 0 ? 'div' : _b, onIntersectionChange = _a.onIntersectionChange; | ||
var _c = tslib_1.__read(hooks_1.useIntersection({ | ||
var _c = __read(hooks_1.useIntersection({ | ||
root: root, | ||
@@ -11,0 +29,0 @@ rootMargin: rootMargin, |
@@ -10,2 +10,4 @@ # Changelog | ||
- Added new types of builds (CommonJS, ESM, esnext, Node) for greater tree-shakability | ||
## [2.0.8] - 2019-10-31 | ||
@@ -12,0 +14,0 @@ |
@@ -1,1 +0,1 @@ | ||
module.exports = require("./build/node/index"); | ||
module.exports = require("./build/cjs/index"); |
{ | ||
"name": "@shopify/react-intersection-observer", | ||
"version": "1.0.0-sknext-beta.1", | ||
"version": "1.0.0-sknext-beta.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A React wrapper around the Intersection Observer API", |
44084
729