This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-14
Channels
- # beginners (110)
- # boot (50)
- # cider (29)
- # cljs-dev (80)
- # cljsrn (10)
- # clojure (54)
- # clojure-italy (3)
- # clojure-korea (24)
- # clojure-russia (50)
- # clojure-spec (12)
- # clojure-taiwan (1)
- # clojure-uk (67)
- # clojurebridge (14)
- # clojurescript (118)
- # component (3)
- # cursive (11)
- # datomic (28)
- # dirac (31)
- # emacs (45)
- # flambo (2)
- # hoplon (53)
- # immutant (3)
- # jobs (5)
- # mount (8)
- # off-topic (10)
- # om (5)
- # onyx (52)
- # other-languages (2)
- # parinfer (1)
- # pedestal (1)
- # proton (39)
- # protorepl (2)
- # re-frame (22)
- # remote-jobs (1)
- # ring (13)
- # ring-swagger (2)
- # test-check (9)
- # untangled (28)
- # vim (12)
@anmonteiro OM-799 needs a rebase
@dnolen thanks, done
@anmonteiro cool work on the js-modules branch I have been wondering how that would work
I'd like to subscribe an Om component to a core.async channel while it is mounted. Being new to both libraries, does that mean that I should create a "cancel"-channel in the component, so that I can stop the go-loop on unmount? Like (alts! [input cancel])
? Or is there a simpler alternative?
I’m playing around with multiple components that take the same data but index it with different idents. I end up having duplicate data in the app db. Mainly because Om can’t know that a link should point to another, and which link should point be pointing in the first place. Any ideas?
(let [st {:app/users [{:id 1
:user/name "Eva"
:user/type :type/foo}
{:id 2
:user/name "Fred"
:user/type :type/foo}
{:id 3
:user/name "Elli"
:user/type :type/bar}]
:app/current-user {:id 1}}
User (ui
static om/Ident
(ident [_ {:keys [id]}]
[:user/by-id id])
static om/IQuery
(query [_]
[:id
:user/name
:user/type]))
UnionFooBar (ui
static om/Ident
(ident [_ {:keys [user/type id]}]
[type id])
static om/IQuery
(query [_]
{:type/foo (om/get-query User)
:type/bar (om/get-query User)
}))]
(pprint
(om/tree->db [{:app/users (om/get-query UnionFooBar)}
{:app/current-user (om/get-query User)}] st true))
{:app/users [[:type/foo 1] [:type/foo 2] [:type/bar 3]],
:app/current-user [:user/by-id 1],
:type/foo
{1 {:id 1, :user/name "Eva", :user/type :type/foo},
2 {:id 2, :user/name "Fred", :user/type :type/foo}},
:type/bar {3 {:id 3, :user/name "Elli", :user/type :type/bar}},
:user/by-id {1 {:id 1, :user/name "Eva", :user/type :type/foo}},
:om.next/tables #{:type/foo :type/bar :user/by-id}})