@flyboarder yes, I’m using boot. This is just a default starter project from documentation. I added some dependencies but removed or changed nothing. I checked out and other handlers work fine (click for example).
Second response down
I see. Is there a way to do it properly in hoplon? I tried this:
(set! js/document.body.onscroll #(println %))
and this works, but looks kinda hacky
btw thank you for a great framework! It’s awesome!1
@denis_krivosheev what are you trying to accomplish? Maybe I can suggest something else, in general you don’t want events attached to the body element.
@flyboarder I want to have top-level infinity-loading paginable screen. Just a regular pattern, scroll to the bottom and when you are quite close then load more data
I know that I can attach this handler to the div, then scroll div and not body, but this is kinda hacky too
No the div is the correct way to do it, you can’t have a scrolling body with infinite space as per the comments on that SO link I posted
@denis_krivosheev ^ there may be other work arounds but attaching an event to the body is the same as
<body onscroll=....> it does not replace the onscroll handler like the snippet you posted does.
Ah ok, I see. Thank you!
Btw @flyboarder does hoplon has some batching functionality or should I use some other tool to batch events?
What type of events?
Yes, like scrolling or mousemove. Dom triggers a lot of them
We don’t do anything special with that
Everything Hoplon does could be done in vanilla JS
This is just perfect 👍 react go away 😃
anyway debouncing and throttling are fun functions to write for yourself in cljs 😄