This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-07
Channels
- # adventofcode (202)
- # aleph (8)
- # announcements (13)
- # architecture (1)
- # aws (2)
- # beginners (201)
- # boot (1)
- # bristol-clojurians (1)
- # calva (2)
- # cider (23)
- # cljs-dev (22)
- # cljsrn (2)
- # clojure (105)
- # clojure-bangladesh (1)
- # clojure-berlin (8)
- # clojure-dev (104)
- # clojure-europe (3)
- # clojure-italy (5)
- # clojure-losangeles (1)
- # clojure-nl (24)
- # clojure-russia (55)
- # clojure-spec (44)
- # clojure-uk (19)
- # clojurescript (58)
- # component (58)
- # cursive (3)
- # data-science (1)
- # datomic (27)
- # duct (6)
- # events (6)
- # figwheel-main (6)
- # fulcro (15)
- # jobs (3)
- # kaocha (5)
- # luminus (1)
- # music (1)
- # nrepl (2)
- # off-topic (24)
- # onyx (1)
- # pedestal (3)
- # protorepl (8)
- # re-frame (18)
- # reagent (39)
- # reitit (1)
- # remote-jobs (1)
- # ring (15)
- # rum (11)
- # shadow-cljs (5)
- # sql (8)
- # tools-deps (12)
- # vim (7)
Is it ok to read component's arguments in a trait? How can I idiomatically extract them from a state?
I've ended up having few helper functions looking like:
(defn focus-when-selected [{args :rum/args :as state}]
(let [[item _] args]
(when (:selected item)
(.focus (rum/ref-node state ::name-input))))
state)
anduse them like
(rum/defcs edit-c <
{ :did-mount focus-when-selected,
:did-update focus-when-selected }
[state item actions]
hello guys! i'am pretty new to rum 🙂 I tried using cursors and found that view (rum/static, rum/reactive) seems not to be updated when i modify meta of cursor data with vary-meta
. is it ok? or what am i doing wrong?
i am trying to use meta data to store things like loading and error flags, etc.
why not?
it's convinient to put such things in meta other then have tree like {:users {:data [...], :loading? false, has-more? true}}
. Does not it?
If your UI cares about those things, that's a sign to me that it should be data, not metadata. I find it's better to avoid using metadata unless you're doing some crazy macro stuff.
makes sense