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 | |
---|
1 | import { useEffect, useState } from 'react';
|
---|
2 | import { off, on } from './misc/util';
|
---|
3 | export 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.