This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-14
Channels
- # admin-announcements (5)
- # aws (3)
- # beginners (35)
- # boot (96)
- # cider (1)
- # clara (6)
- # cljs-dev (12)
- # cljsrn (34)
- # clojure (151)
- # clojure-boston (3)
- # clojure-brasil (4)
- # clojure-canada (1)
- # clojure-czech (8)
- # clojure-dusseldorf (11)
- # clojure-japan (5)
- # clojure-russia (120)
- # clojure-taiwan (1)
- # clojure-uk (3)
- # clojurescript (7)
- # component (27)
- # cursive (13)
- # data-science (45)
- # datomic (1)
- # devcards (5)
- # emacs (3)
- # funcool (65)
- # hoplon (103)
- # instaparse (3)
- # jobs (14)
- # jobs-discuss (1)
- # juxt (2)
- # lein-figwheel (2)
- # off-topic (16)
- # om (20)
- # onyx (49)
- # parinfer (17)
- # perun (1)
- # planck (5)
- # proton (4)
- # re-frame (14)
- # ring-swagger (4)
- # spacemacs (4)
- # untangled (110)
- # yada (14)
hi! is there a best practice or advice on how to handle error responses in the :send function?
particularly I want to handle 400s 401s and 500s and inform the user that something went wrong
What happens in a union query where some of the keys are the same? For example with this query say both have :id
:
{:main (om/get-query MainTab) :settings (om/get-query SettingsTab)}
?@cjmurphy: no problem there
in the Union queries tutorial all queries share attributes
not sure what you mean “kind of like inheritance”
There is a current-tab (i.e. map of props) that you then load into the 'super' (OO terminology) Tab which is generic.
ah right
you can DRY in queries by using an approach such as https://github.com/omcljs/om/blob/master/src/devcards/om/devcards/tutorials.cljs#L304
there, all queries share :favorites
thanks @anmonteiro
All the props are there (because it is a union) but only some of them are used (because not all the props passed in) depending on which tab the user is on.
It is a nice way of doing tabs:
(case type
:main (ui-main-tab props)
:settings (ui-settings-tab props)
(dom/div nil "MISSING TAB"))
props are passed through with another jump. Hmm - sounds complicated but is not too hard when reading the code.
The unionized tab doesn't do any rendering (unless there's a missing tab). It sends the props thru to the one that is supposed to be rendered.
FWIW you can use simple hash-maps in place of case
statements