Socket
Socket
Sign inDemoInstall

@n8tb1t/use-scroll-position

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@n8tb1t/use-scroll-position - npm Package Compare versions

Comparing version 1.0.27 to 1.0.28

6

CHANGELOG.md

@@ -0,1 +1,7 @@

#### 1.0.28 (2019-06-23)
##### Documentation Changes
* Add examples [#1](https://github.com/n8tb1t/use-scroll-position/pull/1) ([bd42b3b2](https://github.com/n8tb1t/use-scroll-position/commit/bd42b3b21c959172edc086eb7894b424ce6e0187))
#### 1.0.27 (2019-06-23)

@@ -2,0 +8,0 @@

2

package.json
{
"name": "@n8tb1t/use-scroll-position",
"version": "1.0.27",
"version": "1.0.28",
"author": "n8tb1t <n8tb1t@gmail.com>",

@@ -5,0 +5,0 @@ "license": "MIT",

# `use-scroll-position`
> TODO: description
[![Node version](https://img.shields.io/npm/v/@n8tb1t/use-scroll-position.svg?style=flat)](https://www.npmjs.com/package/@n8tb1t/use-scroll-position)
[![Node version](https://img.shields.io/librariesio/github/n8tb1t/use-scroll-position.svg?style=flat)](https://libraries.io/npm/@n8tb1t%2Fuse-scroll-position)
[![Node version](https://img.shields.io/github/license/n8tb1t/use-scroll-position.svg?style=flat)](https://github.com/n8tb1t/use-scroll-position/blob/master/LICENSE)
## Install
```
yarn add @n8tb1t/use-scroll-position
```
## Usage
```
const useScrollPosition = require('use-scroll-position');
```jsx
import React, { useState } from 'react'
import { useScrollPosition } from '@n8tb1t/use-scroll-position'
// TODO: DEMONSTRATE API
```
const [hideOnScroll, setHideOnScroll] = useState(true)
useScrollPosition(({ prevPos, currPos }) => {
const isShow = currPos.y > prevPos.y
if (isShow !== hideOnScroll) setHideOnScroll(isShow)
}, [hideOnScroll])
```
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