This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-25
Channels
- # beginners (20)
- # boot (25)
- # cider (1)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (1)
- # clojure (79)
- # clojure-austin (2)
- # clojure-berlin (13)
- # clojure-dusseldorf (1)
- # clojure-germany (7)
- # clojure-russia (10)
- # clojure-serbia (1)
- # clojure-spec (18)
- # clojure-uk (4)
- # clojured (1)
- # clojurescript (90)
- # cursive (10)
- # datomic (7)
- # emacs (14)
- # hoplon (6)
- # luminus (16)
- # lumo (4)
- # numerical-computing (2)
- # om (25)
- # om-next (1)
- # onyx (11)
- # pedestal (10)
- # protorepl (1)
- # reagent (11)
- # remote-jobs (1)
- # ring (1)
- # rum (38)
- # spacemacs (5)
- # test-check (7)
- # untangled (122)
- # vim (1)
- # yada (8)
👍 thanks
@anmonteiro mind giving master a shot if you have a second?
absolutely
@dnolen master looks good
just ran a few tests
@qqq Om Next works with SVG just like React does
Just follow React's docs and you should be fine
https://github.com/swannodette/om-next-demo/tree/master/todomvc <-- is there something simpler than this? I want server/client Om.next, but simplest app possible, i.e. something like a counter that is increment in the client GUI, but whose value is stored on the server
@qqq I’m still figuring stuff out too, but you might want to check out the demo app in this tutorial https://github.com/awkay/om-tutorial
it’s got a simulated server and it’s not quite as simple as a counter, but not much more complex a model
In fact, does anyone know how you should setup a query on a component that’s just responsible for rendering part of another? I’ll try and explain it!
I’ve got a state that looks like this:
(def initial-state {
:address {:address/protocol "http://" :address/domain-path “" }})
and two components like this
(defui HttpProtocol
static om/IQuery
(query [this] [:address/protocol])
Object
(render [this]
(let [protocol (:address/protocol (om/props this))]
(dom/button #js {:className "address-protocol"
:onClick #(om/transact! this `[(address/toggle-protocol {:protocol ~protocol})])} protocol)
))
)
(def http-protocol (om/factory HttpProtocol))
(defui AddressBar
static om/IQuery
(query [this] [(om/get-query HttpProtocol) :address/domain-path])
Object
(render [this]
(let [{:keys [address/protocol address/domain-path]} (om/props this)]
(dom/div #js {:className "address"}
(http-protocol {:address/protocol protocol})
(dom/input #js {:className "address-url" :value domain-path})
(dom/button nil "Go")
))))
(def address-bar (om/factory AddressBar))
The AddressBar gets passed the address, which is fine, but I want to be able to have the HttpProtocol component say it’s reliant on the :address/protocol value. Should I be normalizing the data in some way, so that value is at the top level?
Or should HttpProtocol not have a query? This doesn’t seem right to me but might be the case