This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-24
Channels
- # admin-announcements (2)
- # beginners (46)
- # boot (8)
- # cider (29)
- # cljs-dev (45)
- # cljsjs (10)
- # cljsrn (13)
- # clojure (60)
- # clojure-dev (5)
- # clojure-greece (1)
- # clojure-ireland (4)
- # clojure-mexico (6)
- # clojure-poland (3)
- # clojure-quebec (3)
- # clojure-russia (8)
- # clojure-spec (89)
- # clojure-uk (70)
- # clojurescript (84)
- # cursive (4)
- # datomic (7)
- # devcards (1)
- # dirac (2)
- # emacs (11)
- # hispano (10)
- # jobs (13)
- # keechma (34)
- # lein-figwheel (4)
- # luminus (19)
- # off-topic (2)
- # om (78)
- # onyx (6)
- # parinfer (1)
- # planck (82)
- # proton (2)
- # re-frame (10)
- # reagent (23)
- # ring-swagger (5)
- # spacemacs (2)
- # specter (24)
- # spirituality-ethics (122)
- # untangled (13)
@bocaj Forms are intentionally separated from the rest of keechma. The idea is to use the send-command
function from the UI layer to send the form results to the controller
similar to this https://github.com/keechma/keechma-place-my-order/blob/master/client/src/client/components/order_form.cljs#L111
this example is not using keechma forms (yet!)
but the idea is the same
then you can do whatever you want with the data in the controller layer
I was also figured out that form and inited-form are distinct. Duh:) So, in my render function I'm passing
inited-form
not form
(defn render [ctx] ... (render-login-form inited-form)
yeah, please ask any questions you have 🙂
I’m here to help
Croatia
So, why do you think this is easier for me to pick up than, say, untangled-web and om.next . The hiccup syntax feels more familiar for some reason.
when I started, I had the same feeling
reagent is such an elegant abstraction
I really like that components are only a function, not a macro
Can you explain or point me to when to call a component in a vec vs a list
[render-stuff x]
(render-stuff x)
so those are not the same, when in vec reagent will actually mount it as a component
when you call it as function
you will immediately get the result returned
so it’s actually function call vs vector
I use function calls for helper like functionality, small extractions that are actually part of the bigger components
Ok. So for a rule of thumb/heuristic use a vector to mount a component at "app" level, and functions to build things up at "my-component" level
yeah, you could put it like that. My rule of thumb is, if it’s in the same file make it a function, otherwise it’s probably a component (unless you have a file with bunch of helpers :))
oh, that makes sense. So, you use "c-my-component" in a let bind with (ui/component ctx ...) , then you'd probably use [c-my-component]
What if this in the demo
(def form (f/constructor validator))
were (def form-fn (f/constructor validator))
or new-formI don’t really understand the question, but to explain how the f/constructor
works - it has two arities one where you call it with the validator only (f/constructor validator)
and one where you call it with the validator, data and opts (f/constructor validator data opts)
if you call it with the validator only, it will return a function that can be used to create a form “instance” - where you pass it data and opts later. This way you can bind form to the validator and pass it around as one thing
I was trying to say, that in the demo you could rename the var to form-fn to indicate what the var type was. You pass around "form" as params in the rest of the demo, which is a form-instance.
ah, makes sense