@n8tb1t/use-scroll-position
Advanced tools
Comparing version 1.0.27 to 1.0.28
@@ -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 @@ |
{ | ||
"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]) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6649
24