This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-15
Channels
- # announcements (1)
- # asami (29)
- # babashka (31)
- # beginners (48)
- # calva (39)
- # cljsrn (4)
- # clojure (56)
- # clojure-dev (51)
- # clojure-doc (3)
- # clojure-europe (40)
- # clojure-gamedev (13)
- # clojure-italy (22)
- # clojure-nl (3)
- # clojure-uk (5)
- # cursive (9)
- # datomic (184)
- # events (7)
- # fulcro (8)
- # graalvm (2)
- # jobs (1)
- # malli (6)
- # meander (1)
- # nrepl (5)
- # off-topic (10)
- # pathom (9)
- # polylith (33)
- # portal (2)
- # re-frame (7)
- # reagent (12)
- # releases (3)
- # remote-jobs (3)
- # reveal (27)
- # shadow-cljs (34)
- # sql (1)
- # vim (7)
- # xtdb (62)
When would you load data for a component in Fulcro? I’m not using the router right now, but I’m used to loading data in interceptors with reitit, or just on component mount with plain React. What’s the Fulcro version of doing something like that?
Most of my io is done in UI state machines or the routing layer. Usually a combination of the two.
see https://fulcro-community.github.io/guides/tutorial-minimalist-fulcro/index.html#_when_to_load
https://github.com/roterski/fulcro-rad-demo/blob/570047474e301e51f7a01f20e9ef5f3a38398d5b/src/xtdb/com/example/components/xtdb.clj#L7-L12
@pt.roterski I'm not totally sure, but does this break when using something other than jdbc? I'm using RocksDB and I've had to modify it to look for the :main
key in the config map instead of using for
. I'm not sure if that would be different if there was a connection pool. Maybe doseq
would be a better choice anyhow - it's intended for side-effects whereas the for
produces a lazy seq. I could just be misusing it :man-shrugging: but I think I have it working for my particular needs right now, just wanted to ask about it.
hey @UPWHQK562, thanks for noticing it. Yeah, it looks like it could cause some problems so changing it to doseq
seems like a good idea.
Thanks @pt.roterski!