This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-18
Channels
- # admin-announcements (3)
- # arachne (8)
- # beginners (55)
- # boot (51)
- # cbus (1)
- # cider (15)
- # cljs-dev (5)
- # cljsrn (8)
- # clojure (203)
- # clojure-austin (2)
- # clojure-belgium (12)
- # clojure-boston (6)
- # clojure-czech (47)
- # clojure-dusseldorf (14)
- # clojure-estonia (1)
- # clojure-greece (42)
- # clojure-japan (2)
- # clojure-poland (4)
- # clojure-russia (97)
- # clojure-sg (5)
- # clojure-uk (41)
- # clojurescript (122)
- # code-reviews (4)
- # component (3)
- # core-matrix (19)
- # cursive (25)
- # datomic (16)
- # devcards (24)
- # editors (6)
- # euroclojure (1)
- # hoplon (88)
- # immutant (3)
- # incanter (4)
- # jobs (5)
- # keechma (1)
- # luminus (1)
- # om (44)
- # onyx (22)
- # parinfer (3)
- # planck (1)
- # proton (3)
- # re-frame (5)
- # reagent (30)
- # ring (2)
- # spacemacs (1)
- # untangled (92)
- # yada (1)
1 thing I don’t quire get in reagent:
(map (fn [i] [:p {:style {:font-size "16px"}} i]) li)
and
(for [i li]
[:p {:style {:font-size "16px"}} i])
seem to work and do the same thing@tmtwd: if you want to force evaluation, you can use doall
Has somebody implemented an ‘infinite scroll’ component in reagent/re-frame webapp? Or maybe used some existing OS one? I am doing a chat view and need to show older messages when you scroll up. There are some components for react available, but I’m not sure how to setup any of those in my project. Maybe it worth building from scratch?
@drapanjanas: one sec
@drapanjanas: oh, I misread haha
the above is "auto-scroll", not infinite/lazy-load scroll
@martinklepsch: thanks anyway, I guess I can add some lazy loading
This conversation made me wonder, how to write a auto-scroll thing and an infinite-scroll thing in a way they can be nicely composed?
@drapanjanas: i've got one... you are welcome to have a look if that would be useful, though it's kinda tied to some of my app concepts
@mccraigmccraig: yeah I would like to, well I am thinking what to do, so you chose to build one your one right? I need only lazy loading for now, as simple as possible, and don’t want to depend of half of internet.
here's the app-db schema - https://www.refheap.com/b1212cedfc42a0b6ec78816b0 and the component itself - https://www.refheap.com/3becdb6258a7868756ab9e479
@mccraigmccraig: thanks a lot! It will help me to decide
@drapanjanas: here's the reagent infinite scroll component that we have in Roomstorm: https://gist.github.com/nberger/b5e316a43ffc3b7d5e084b228bd83899. We use it with re-frame, but of course you can use it with just reagent, you just need to give it a map with :position :can-show-more? :load-fn
keys
@nberger: is it intentional that this component doesn't render anything? or did you omit that?
oh, this is global and so you don't need it. got it
if you have only one thing which you want to infinitely scroll that makes sense
and I now see that we are not using the position at all... so just can-show-more?
and load-fn
. If can-show-more?
is true and it detects we are close to the bottom of the page, it triggers load-fn
@nberger: cool, I use re-frame in my webapp, thanks a lot!