I would like to do something similar to Reagent form-3 components, which
enable me to define some shared (static) vars I can reuse in all lifecycle
functions in specific instantiations of my component.
Basically my question is how do I construct something equivalent to the let in
the Reagent code snippet below? I can't seem to figure out how to do this
properly using Om's defui macro.
A simple example would be to generate ids for specific elements to enable
efficient access to those elements in all lifecycle functions of a specific
instance of my component via gdom/getElement.
(defn my-component
[x y z]
(let [id (gensym "my-component-")] ;; <-- how to do this in Om?
(reagent/create-class
{:component-did-mount (...)
:component-will-mount (...)
:reagent-render
(fn [x y z] (...))))
I am new to Om.Next but I assume something like this is possible. If I am
somehow committing cardinal sins with this approach please let me know.
I've also posted this question on SO here
<https://stackoverflow.com/q/47181093/2148672>.
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.