Socket
Socket
Sign inDemoInstall

@blaze-react/utils

Package Overview
Dependencies
Maintainers
11
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blaze-react/utils - npm Package Compare versions

Comparing version 0.5.0 to 0.5.13

60

lib/customHooks/useInView/index.js

@@ -41,10 +41,4 @@ "use strict";

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
exports.__esModule = true;
require("intersection-observer");
var prop_types_1 = __importDefault(require("prop-types"));

@@ -61,33 +55,25 @@ var react_1 = require("react");

return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (typeof window === "undefined") {
return [2 /*return*/];
}
usableRef = ref || outerRef;
current = (usableRef || {}).current;
if (!current) {
return [2 /*return*/];
}
return [4 /*yield*/, window.IntersectionObserver];
case 1:
(_a.sent())
? Promise.resolve()
: Promise.resolve().then(function () { return __importStar(require("intersection-observer")); });
newObserver = new IntersectionObserver(function (_a, observer) {
var entry = _a[0];
var _b;
setIntersecting(entry.isIntersecting);
if (entry.isIntersecting) {
once && ((_b = observer) === null || _b === void 0 ? void 0 : _b.unobserve(current));
}
}, {
rootMargin: offset
});
current && newObserver.observe(current);
return [2 /*return*/, function () {
var _a;
(_a = newObserver) === null || _a === void 0 ? void 0 : _a.unobserve(current);
}];
if (typeof window === "undefined") {
return [2 /*return*/];
}
usableRef = ref || outerRef;
current = (usableRef || {}).current;
if (!current) {
return [2 /*return*/];
}
newObserver = new IntersectionObserver(function (_a, observer) {
var entry = _a[0];
var _b;
setIntersecting(entry.isIntersecting);
if (entry.isIntersecting) {
once && ((_b = observer) === null || _b === void 0 ? void 0 : _b.unobserve(current));
}
}, {
rootMargin: offset
});
current && newObserver.observe(current);
return [2 /*return*/, function () {
var _a;
(_a = newObserver) === null || _a === void 0 ? void 0 : _a.unobserve(current);
}];
});

@@ -94,0 +80,0 @@ }); })();

{
"name": "@blaze-react/utils",
"version": "0.5.0",
"version": "0.5.13",
"publishConfig": {

@@ -41,3 +41,3 @@ "access": "public"

},
"gitHead": "dbdf30fbcbab501a47076a8bdc65117bd1faf6d1"
"gitHead": "1ec9a2d491939a3399a04fe086a34f88c51a0351"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc