This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-19
Channels
- # admin-announcements (2)
- # aws-lambda (3)
- # beginners (66)
- # boot (61)
- # cider (1)
- # cljs-dev (17)
- # clojure (100)
- # clojure-austin (4)
- # clojure-brasil (1)
- # clojure-canada (8)
- # clojure-quebec (6)
- # clojure-russia (48)
- # clojure-sg (6)
- # clojure-spec (37)
- # clojure-uk (61)
- # clojure-ukraine (2)
- # clojurescript (80)
- # core-async (13)
- # cursive (20)
- # datascript (37)
- # datomic (2)
- # defnpodcast (4)
- # emacs (5)
- # funcool (3)
- # hoplon (11)
- # jobs (7)
- # juxt (26)
- # lein-figwheel (48)
- # leiningen (3)
- # luminus (3)
- # om (34)
- # om-next (5)
- # onyx (5)
- # protorepl (6)
- # re-frame (10)
- # reagent (9)
- # rethinkdb (16)
- # ring-swagger (5)
- # spacemacs (14)
- # specter (54)
- # untangled (36)
- # vim (75)
- # yada (1)
@ag Here you see all tags: https://github.com/omcljs/om/blob/master/src/main/om/dom.clj#L4 what do you need custom html tag for?
@hlolli: I’m trying to render a web-component inside react/om.next component. It’s basically a custom tag. For some reason “transclusion” not working with Sablono. I was hoping it may with om.dom
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. https://gist.github.com/niamu/43c0e9a7c3dd2a10c061a905ab3042ae
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 om.next 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?
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.
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
@anmonteiro: thanks
@ethangracer: confirmed it’s a bug with singletons in data. vectors work well and are well tested
good catch
@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