updwn
Detect up/down directional scrolling. 500 bytes gzipped.
Install
npm i updwn --save
Usage
Handlers are only fired when the scroll direction changes and the scroll speed exceeds a configurable threshold value.
const scroll = scrollscroll scrollposition // => 'up' or 'down'
Handlers can be destroyed by calling the function returned at the time of their definition.
const destroy = scroll
License
MIT License © Eric Bailey