This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-27
Channels
- # announcements (1)
- # babashka (2)
- # beginners (64)
- # cider (1)
- # cljs-dev (49)
- # cljsrn (2)
- # clojure (49)
- # clojure-europe (3)
- # clojure-norway (1)
- # clojure-spec (7)
- # clojurescript (116)
- # conjure (3)
- # cursive (4)
- # datomic (1)
- # emacs (2)
- # fulcro (15)
- # graalvm (10)
- # kaocha (1)
- # leiningen (4)
- # meander (1)
- # music (1)
- # off-topic (7)
- # re-frame (37)
- # reagent (3)
- # releases (1)
- # rewrite-clj (6)
- # sci (4)
- # shadow-cljs (16)
- # sql (8)
- # tools-deps (16)
- # xtdb (5)
Hey @jayzawrotny, I'm a little late to the party, but I found this blog post to be very apropos https://juxt.pro/blog/cljs-apps
Thanks @U0CJ19XAM
@jayzawrotny I do have one example from a commercial app I've worked on for the last few years:
(s/fdef dre.components.widget/widget
:args
(s/and
(s/cat
:opts
(s/keys
:req-un [::title ;; title in header
::content ;; Contents to show in widget. It must be a Hiccup
;; vector. Widget does not support varying arguments in
;; content, they are for initialization only.
]
:opt-un [::id ;; unique identifier for widget (page wide, not app
;; wide)
::icon ;; icon to show in header
::widget-class ;; CSS class
::collapsable? ;; If it can be collapsed
::init-collapsed? ;; initialize the widget in a collapsed
;; state?
::help ;; help contents which are shown in modal
::controls ;; Arbitrary component rendered in the
;; header. What it does is up to you.
::selections ;; coll of dropdown/tabs
::dropdown ;; convenience option, singular version of
;; selections with
;; {:type :dropdown, :id :dropdown} by default
::tabs ;; convenience option, singular version of selections
;; with {:type :tabs, :id :tabs}
::loading? ;; Whether or not to display a loading indicator
::locked? ;; Whether or not content modifications are possible
::menu ;; menu
::on-will-unmount]))
(fn [{:keys [opts]}]
(if-let [unexpected
(seq (apply dissoc opts expected-keys))]
(do
(warn "Unexpected options" unexpected)
false)
true))))
@jayzawrotny This is about the only Reagent component I've spec-ed because it has so many options
Not sure if it's useful, but this is the app: http://covid19.doctorevidence.com/ (this is a free preview of it)