This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-13
Channels
- # beginners (42)
- # boot (33)
- # cider (4)
- # clara (1)
- # cljs-dev (2)
- # clojars (3)
- # clojure (207)
- # clojure-boston (1)
- # clojure-france (3)
- # clojure-india (7)
- # clojure-miami (1)
- # clojure-nl (8)
- # clojure-poland (13)
- # clojure-russia (102)
- # clojure-spec (22)
- # clojure-uk (37)
- # clojureremote (15)
- # clojurescript (229)
- # cursive (9)
- # datomic (1)
- # emacs (7)
- # figwheel (2)
- # funcool (1)
- # garden (1)
- # hoplon (7)
- # jobs (12)
- # jobs-discuss (27)
- # juxt (2)
- # leiningen (6)
- # luminus (9)
- # lumo (18)
- # off-topic (3)
- # onyx (9)
- # re-frame (54)
- # reagent (5)
- # remote-jobs (3)
- # ring (3)
- # rum (3)
- # specter (28)
- # yada (30)
i ran into a situation where i’d like to have a component parameterize functionality in react lifecycle methods. basically i want a wrapper component for a bunch of different quil sketches, and i’d like to do something like (sketch-wrapper <sketch>)
, where the component will size itself, etc from the sketch parameters. the thing is i need to be able to call the particular sketch start function during :did-mount
. normally in rum i’d use a mixin:
(defc sketch-wrapper < {:did-mount sketch-start-fn}
[{:keys [sketch-start-fn]}]
...)
but that doesn’t work here because the component arguments aren’t available when defining the mixin this way. in reagent i could do something like:
(defn sketch-wrapper [{:keys [sketch-start-fn]}]
(r/create-class
{:component-did-mount sketch-start-fn
...
is there a way to do something like this in rum?