Fork me on GitHub
#hoplon
<
2019-02-28
>
denis_krivosheev05:02:14

@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).

flyboarder07:02:13

@denis_krivosheev I see, you can’t attach scroll to body

flyboarder07:02:31

Second response down

denis_krivosheev08:02:00

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

denis_krivosheev08:02:16

btw thank you for a great framework! It’s awesome!

pizzaspin 5
flyboarder17:02:51

@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.

denis_krivosheev18:02:37

@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

denis_krivosheev18:02:38

I know that I can attach this handler to the div, then scroll div and not body, but this is kinda hacky too

flyboarder18:02:50

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

flyboarder18:02:40

@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.

denis_krivosheev18:02:03

Ah ok, I see. Thank you!

denis_krivosheev18:02:16

Btw @flyboarder does hoplon has some batching functionality or should I use some other tool to batch events?

flyboarder18:02:40

What type of events?

denis_krivosheev18:02:49

Yes, like scrolling or mousemove. Dom triggers a lot of them

flyboarder18:02:08

We don’t do anything special with that

flyboarder18:02:25

Everything Hoplon does could be done in vanilla JS

denis_krivosheev18:02:06

This is just perfect 👍 react go away 😃

alandipert18:02:23

anyway debouncing and throttling are fun functions to write for yourself in cljs 😄

mynomoto17:03:47

Those exist on Google closure library, if you want to skip the fun part. 😉

🙂 5
mynomoto17:03:47

Those exist on Google closure library, if you want to skip the fun part. 😉

🙂 5