Fork me on GitHub

@ag Here you see all tags: what do you need custom html tag for?


@hlolli: I’m trying to render a web-component inside react/ component. It’s basically a custom tag. For some reason “transclusion” not working with Sablono. I was hoping it may with om.dom


you mean jsx tag?


Several days ago I was asking about the possibility of using Hiccup/Sablono syntax with Om Next and Cellophane. Today I’m happy to declare that I have a working demo of that.


Hickory made things easy.


Can anyone confirm what I believe to be a bug in db->tree:

(deftest test-numbers
  (let [state (atom {:union-join   [:panel :a]
                     :union-join-2 [:dashboard :b]
                     :dashboard    {:b {:x 2 :y 1 :z [:dashboard :c]}
                                    :c {:x 3 :y 7 :z [:dashboard :d]}
                                    :d {:x 5 :y 10}}
                     :panel        {:a {:x 1 :n 4}}})
        query [{:union-join-2 {:panel [:x :n] :dashboard [:x :y {:z '...}]}}]
        expected-result {:union-join-2 {:x 2 :y 1 :z {:x 3 :y 7 :z {:x 5 :y 10}}}}]
    (is (= expected-result (om/db->tree query @state @state)))))
;; returns {:union-join-2 {:x 2 :y 1 :z {}}}


seems to be an issue with recursion nested in a union query


the direct recursive query works fine

[{:dashboard [{:b [:x :y {:z '...}]}]}] —> {:dashboard {:b {:x 2 :y 1 :z {:x 3 :y 7 :z {:x 5 :y 10}}}}}


I’m still struggling up the hill of mastery, so please let me know if what I’m asking for seems incorrect in some way. As part of our authentication flow, we want to open a popout window and refresh some remote data when the window closes. After a couple of different arrangements that are more or less unsatisfactory, I’m thinking that the Right Thing to do is to have a component that opens a window when a particular state transition occurs, watches the window’s status in a go-loop, and applies a transaction when it closes. I’m not sure what lifecycle protocols I should hook into to set this up correctly though. Any advice?


@donaldball: If you have a go-loop that exits, then there is no reason why you couldn’t just run a transaction at the end. We have been using a dedicated end point for our auth (oauth), and redirects back to the index.


The place where I have the window opening and the go-loop right now is in a send-fn callback. If I were to apply a transaction at that point, I’d need a reference to the component or the reconciler, which I don’t have, right?


Do you have the reconciler


because you could transact with that


I don’t, and I don’t even know how I’d thread it in. The send-fn impl would need a reference to it, but that feels weird because the reconciler owns the send-fn. Ultimately, it feels like opening a window is a UI thing and it really ought to happen in a component, I just don’t know enough about the react lifecycle events or how om manages them.


Could you just use a dom event? I have had to hook into those for drag and drop. We’ve moved away from lifecycle things unless totally necessary (in most cases)


Can’t think of what dom event I’d use tbqh. I can’t open the auth popup window until the user has requested and received an auth url.


Are you using websockets? Is that why you have a go-loop in the send-fn? Sounds like you might want to move this out of the send-fn


No, the only reason for the go-loop is to poll for the window closing. It appears you can’t receive events from windows that open across domains.


But yes, your critique is correct, I think: I’m trying to find a way to express this in an om ui object.


Yeah, hanging out in the send-fn might not be the best idea.


You could use an app state marker to do the notification


Right, but it’s not clear to me how, if at all, I could trigger an effect in my ui component only on a given state transition


I could open the window in the send-fn and put a ref into the app state for the ui to watch, but, eh, that still feels like like the wrong place


@ethangracer: seems like a bug. investigating


@ethangracer: confirmed it’s a bug with singletons in data. vectors work well and are well tested


@anmonteiro: huh, what singletons — the union idents? want an issue for it?


i tried tracing a bit in the code but got lost 😅


@ethangracer: singletons in the recursion. in your example :z [:dashboard :c] instead of :z [[:dashboard :c]] which would work


ahh very interesting


I’ll open the issue, got a more minimal case


great, thanks