Fork me on GitHub
#om
<
2017-02-25
>
dnolen00:02:42

actually just going to fix this now

dnolen00:02:33

@anmonteiro mind giving master a shot if you have a second?

dnolen00:02:18

cutting a release now too

anmonteiro00:02:35

@dnolen master looks good

anmonteiro00:02:40

just ran a few tests

anmonteiro05:02:56

@qqq Om Next works with SVG just like React does

anmonteiro05:02:19

Just follow React's docs and you should be fine

qqq21:02:11

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

bunkers21:02:02

@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

bunkers21:02:45

it’s got a simulated server and it’s not quite as simple as a counter, but not much more complex a model

qqq21:02:43

@bunkers: is that pure OM, or is that OM + Untangled ?

bunkers21:02:31

Just OM (as far as I know)

bunkers21:02:48

it’s the demo app from the dev card tutorials

bunkers21:02:03

The whole thing has been pretty useful for me

bunkers21:02:24

Although queries and idents are still causing me some headaches

bunkers21:02:26

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!

bunkers21:02:24

I’ve got a state that looks like this:

(def initial-state {
                    :address {:address/protocol "http://" :address/domain-path “" }})

bunkers21:02:42

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))

bunkers21:02:26

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?

bunkers21:02:19

Or should HttpProtocol not have a query? This doesn’t seem right to me but might be the case

cjmurphy22:02:15

Normally it would be (http-protocol protocol). Also HttpProtocol is not stateless so needs a query.

cjmurphy22:02:53

Hmm - the rendering for HttpProtocol - couldn't it just go into AddressBar?

bunkers22:02:46

Yeah it probably could but I'm interested in what happens in a situation like this. If you want to make a component out of it for use elsewhere, for example