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

@react-hook/window-scroll

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-hook/window-scroll - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

4

dist/main/index.js

@@ -21,2 +21,4 @@ 'use strict'

const win = typeof window === 'undefined' ? null : window
const useWindowScroll = (fps = 30) => {

@@ -28,3 +30,3 @@ const [scrollY, setThrottledScroll] = (0, _throttle.useThrottle)(

)
;(0, _event.default)(window, 'scroll', () => setThrottledScroll(getScrollY()))
;(0, _event.default)(win, 'scroll', () => setThrottledScroll(getScrollY()))
return scrollY

@@ -31,0 +33,0 @@ }

@@ -11,2 +11,3 @@ import {useThrottle} from '@react-hook/throttle'

const win = typeof window === 'undefined' ? null : window
export const useWindowScroll = (fps = 30) => {

@@ -18,5 +19,5 @@ const [scrollY, setThrottledScroll] = useThrottle(

)
useEvent(window, 'scroll', () => setThrottledScroll(getScrollY()))
useEvent(win, 'scroll', () => setThrottledScroll(getScrollY()))
return scrollY
}
export default useWindowScroll
{
"name": "@react-hook/window-scroll",
"version": "1.2.2",
"version": "1.2.3",
"homepage": "https://github.com/jaredLunde/react-hook/tree/master/packages/window-scroll#readme",

@@ -87,3 +87,3 @@ "repository": "github:jaredLunde/react-hook",

"dependencies": {
"@react-hook/event": "^1.0.4",
"@react-hook/event": "^1.1.0",
"@react-hook/throttle": "^2.1.2"

@@ -90,0 +90,0 @@ },

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