source: imaps-frontend/node_modules/react-use/esm/useMouseWheel.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 514 bytes
Line 
1import { useEffect, useState } from 'react';
2import { off, on } from './misc/util';
3export default (function () {
4 var _a = useState(0), mouseWheelScrolled = _a[0], setMouseWheelScrolled = _a[1];
5 useEffect(function () {
6 var updateScroll = function (e) {
7 setMouseWheelScrolled(e.deltaY + mouseWheelScrolled);
8 };
9 on(window, 'wheel', updateScroll, false);
10 return function () { return off(window, 'wheel', updateScroll); };
11 });
12 return mouseWheelScrolled;
13});
Note: See TracBrowser for help on using the repository browser.