1// Generated by purs version 0.13.6
3var Control_Applicative = require("../Control.Applicative/index.js");
4var Data_Eq = require("../Data.Eq/index.js");
5var Data_Function = require("../Data.Function/index.js");
6var Data_Newtype = require("../Data.Newtype/index.js");
7var Data_Unit = require("../Data.Unit/index.js");
8var React_Basic_Hooks = require("../React.Basic.Hooks/index.js");
9var React_Basic_Hooks_Internal = require("../React.Basic.Hooks.Internal/index.js");
10var Type_Equality = require("../Type.Equality/index.js");
11var Web_Event_EventTarget = require("../Web.Event.EventTarget/index.js");
12var Web_HTML = require("../Web.HTML/index.js");
13var Yoga_Scroll_Listener = require("../Yoga.Scroll.Listener/index.js");
14var UseScrollYPosition = function (x) {
17var ntUseScrollYPosition = new Data_Newtype.Newtype(function (n) {
19}, UseScrollYPosition);
20var makeListener = function (setPosition) {
21 return Web_Event_EventTarget.eventListener(Data_Function["const"](function __do() {
22 var win = Web_HTML.window();
23 return setPosition(win.scrollY)();
26var useScrollYPosition = React_Basic_Hooks_Internal.coerceHook(ntUseScrollYPosition)(React_Basic_Hooks_Internal.bind(React_Basic_Hooks_Internal.ixBindRender)(React_Basic_Hooks.useState(0.0))(function (v) {
27 var setScrollY = function ($545) {
28 return v.value1(Data_Function["const"]($545));
30 return React_Basic_Hooks_Internal.discard(React_Basic_Hooks_Internal.ixBindRender)(React_Basic_Hooks.useLayoutEffect(Data_Eq.eqUnit)(Data_Unit.unit)(function __do() {
31 var listener = makeListener(setScrollY)();
32 return Yoga_Scroll_Listener.registerListener(listener)();
33 }))(function ($dollar__unused) {
34 return Control_Applicative.pure(React_Basic_Hooks_Internal.applicativeRender(Type_Equality.refl))(v.value0);
38 UseScrollYPosition: UseScrollYPosition,
39 useScrollYPosition: useScrollYPosition,
40 makeListener: makeListener,
41 ntUseScrollYPosition: ntUseScrollYPosition
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list