This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-29
Channels
- # beginners (24)
- # boot (6)
- # cider (22)
- # cljsjs (1)
- # cljsrn (12)
- # clojars (3)
- # clojure (170)
- # clojure-china (2)
- # clojure-dusseldorf (18)
- # clojure-finland (1)
- # clojure-italy (32)
- # clojure-nl (1)
- # clojure-russia (65)
- # clojure-sanfrancisco (1)
- # clojure-spec (21)
- # clojure-uk (46)
- # clojurescript (92)
- # clojutre (1)
- # clr (7)
- # cursive (7)
- # datomic (6)
- # dirac (49)
- # emacs (17)
- # events (1)
- # funcool (20)
- # hoplon (6)
- # job (1)
- # jobs (1)
- # keechma (2)
- # leiningen (6)
- # lumo (74)
- # off-topic (15)
- # om (7)
- # onyx (40)
- # overtone (4)
- # pedestal (8)
- # powderkeg (4)
- # proton (2)
- # protorepl (2)
- # re-frame (18)
- # reagent (24)
- # ring-swagger (3)
- # rum (15)
- # slack-help (1)
- # spacemacs (20)
- # uncomplicate (62)
- # unrepl (29)
- # untangled (10)
- # yada (10)
@jeroenvandijk Thanks, it looks like the thing I want
@renewdoit just for my understanding, do you mean the global-mixin or the theme approach
@jeroenvandijk I am trying to switch a set of components, it is like a theme, but the components itself is different.
I have a component which performs rather heavy computation based on some of its args. I'm trying to find a way to not perform this computation if these specific args have not changed. Any suggestions? From reading the React docs it seems that componentWillReceiveProps()
is where I'd do it, but rum doesn't expose that. Should I use :will-update
? Also, I find React docs confusing: "you cannot call this.setState()
here" — this doesn't apply to changing rum component state, right?
I have the same problem, I do check props in :will-update
and update rum state via swap!
its atom.
I’m not a React expert, nor Rum mixin expert, but I’m able to prevent unwanted updates by having several layers of components. So say you have three atoms with three different desired update behaviours, I can imagine you would nest the components or have several components in one
For instance, i’m generating a complex form, with multi-staged commits. I’m only able to do this by organising it this way. I’m passing atoms around to do this. Hope this makes sense
@rauh No, I do want the component to update on every arg change. I just want to avoid the expensive computation that does not depend on all args, so in some cases could be avoided.
@nxqd Do you mean you swap!
the state of a rum/local
mixin atom, or the main component state? I thought the main state gets updated when you return it from the mixin fn?