Socket
Socket
Sign inDemoInstall

@lani.ground/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lani.ground/react-hooks - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

1

dist/cjs/useVisibleElement.d.ts

@@ -0,1 +1,2 @@

/// <reference types="react" />
interface Props {

@@ -2,0 +3,0 @@ key?: string;

@@ -15,3 +15,9 @@ "use strict";

}, []);
var cancelScrollEvent = (0, react_1.useCallback)(function (event) {
event.preventDefault();
}, []);
var lockScroll = function () {
var isScrollLocked = document.body.style.position === 'fixed';
if (isScrollLocked)
return;
scrollRef.current = window.scrollY;

@@ -25,2 +31,5 @@ modifyBodyStyle({

});
document.addEventListener('touchmove', cancelScrollEvent, {
passive: false,
});
};

@@ -36,2 +45,5 @@ var unlockScroll = function () {

window.scrollTo({ left: 0, top: scrollRef.current, behavior: 'instant' });
document.addEventListener('touchmove', cancelScrollEvent, {
passive: false,
});
};

@@ -38,0 +50,0 @@ return {

@@ -0,1 +1,2 @@

/// <reference types="react" />
interface Props {

@@ -2,0 +3,0 @@ key?: string;

@@ -13,3 +13,9 @@ import { useCallback, useRef } from 'react';

}, []);
var cancelScrollEvent = useCallback(function (event) {
event.preventDefault();
}, []);
var lockScroll = function () {
var isScrollLocked = document.body.style.position === 'fixed';
if (isScrollLocked)
return;
scrollRef.current = window.scrollY;

@@ -23,2 +29,5 @@ modifyBodyStyle({

});
document.addEventListener('touchmove', cancelScrollEvent, {
passive: false,
});
};

@@ -34,2 +43,5 @@ var unlockScroll = function () {

window.scrollTo({ left: 0, top: scrollRef.current, behavior: 'instant' });
document.addEventListener('touchmove', cancelScrollEvent, {
passive: false,
});
};

@@ -36,0 +48,0 @@ return {

4

package.json
{
"name": "@lani.ground/react-hooks",
"description": "react hooks",
"version": "0.3.1",
"version": "0.3.2",
"keywords": [

@@ -73,3 +73,3 @@ "react-hooks",

},
"gitHead": "4b223121d27a813a98864c47013e4b856b0b6e1a"
"gitHead": "edbc9ab5d456073ba4154f0e04a35ae71311eda9"
}
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