Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@peersyst/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peersyst/react-hooks - npm Package Compare versions

Comparing version 1.2.6 to 1.2.7

10

esm/useScrollTrigger.js

@@ -22,3 +22,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

if (target) {
if (target && typeof window !== "undefined") {
// Get vertical scroll

@@ -39,3 +39,2 @@ store.current = target.scrollY !== undefined ? target.scrollY : target.scrollTop;

var defaultTarget = window;
export default function useScrollTrigger() {

@@ -46,4 +45,3 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

getTrigger = _options$getTrigger === void 0 ? defaultTrigger : _options$getTrigger,
_options$target = options.target,
target = _options$target === void 0 ? defaultTarget : _options$target,
optionsTarget = options.target,
other = _objectWithoutProperties(options, _excluded);

@@ -61,2 +59,4 @@

useEffect(function () {
var target = optionsTarget || window;
var handleScroll = function handleScroll() {

@@ -74,4 +74,4 @@ setTrigger(getTrigger(store, _objectSpread({

};
}, [target, getTrigger, JSON.stringify(other)]);
}, [optionsTarget, getTrigger, JSON.stringify(other)]);
return trigger;
}

@@ -22,3 +22,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

if (target) {
if (target && typeof window !== "undefined") {
// Get vertical scroll

@@ -39,3 +39,2 @@ store.current = target.scrollY !== undefined ? target.scrollY : target.scrollTop;

var defaultTarget = window;
export default function useScrollTrigger() {

@@ -46,4 +45,3 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

getTrigger = _options$getTrigger === void 0 ? defaultTrigger : _options$getTrigger,
_options$target = options.target,
target = _options$target === void 0 ? defaultTarget : _options$target,
optionsTarget = options.target,
other = _objectWithoutProperties(options, _excluded);

@@ -61,2 +59,4 @@

useEffect(function () {
var target = optionsTarget || window;
var handleScroll = function handleScroll() {

@@ -74,4 +74,4 @@ setTrigger(getTrigger(store, _objectSpread({

};
}, [target, getTrigger, JSON.stringify(other)]);
}, [optionsTarget, getTrigger, JSON.stringify(other)]);
return trigger;
}

@@ -22,3 +22,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

if (target) {
if (target && typeof window !== "undefined") {
// Get vertical scroll

@@ -39,3 +39,2 @@ store.current = target.scrollY !== undefined ? target.scrollY : target.scrollTop;

var defaultTarget = window;
export default function useScrollTrigger() {

@@ -46,4 +45,3 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

getTrigger = _options$getTrigger === void 0 ? defaultTrigger : _options$getTrigger,
_options$target = options.target,
target = _options$target === void 0 ? defaultTarget : _options$target,
optionsTarget = options.target,
other = _objectWithoutProperties(options, _excluded);

@@ -61,2 +59,4 @@

useEffect(function () {
var target = optionsTarget || window;
var handleScroll = function handleScroll() {

@@ -74,4 +74,4 @@ setTrigger(getTrigger(store, _objectSpread({

};
}, [target, getTrigger, JSON.stringify(other)]);
}, [optionsTarget, getTrigger, JSON.stringify(other)]);
return trigger;
}

@@ -34,3 +34,3 @@ "use strict";

if (target) {
if (target && typeof window !== "undefined") {
// Get vertical scroll

@@ -51,4 +51,2 @@ store.current = target.scrollY !== undefined ? target.scrollY : target.scrollTop;

var defaultTarget = window;
function useScrollTrigger() {

@@ -58,4 +56,3 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

getTrigger = _options$getTrigger === void 0 ? defaultTrigger : _options$getTrigger,
_options$target = options.target,
target = _options$target === void 0 ? defaultTarget : _options$target,
optionsTarget = options.target,
other = (0, _objectWithoutProperties2["default"])(options, _excluded);

@@ -72,2 +69,4 @@ var store = (0, _react.useRef)();

(0, _react.useEffect)(function () {
var target = optionsTarget || window;
var handleScroll = function handleScroll() {

@@ -85,4 +84,4 @@ setTrigger(getTrigger(store, _objectSpread({

};
}, [target, getTrigger, JSON.stringify(other)]);
}, [optionsTarget, getTrigger, JSON.stringify(other)]);
return trigger;
}
{
"name": "@peersyst/react-hooks",
"author": "Peersyst",
"version": "1.2.6",
"version": "1.2.7",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "./node/index.js",

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