This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-28
Channels
- # aws (1)
- # babashka (113)
- # beginners (41)
- # cider (9)
- # cljdoc (15)
- # cljs-dev (8)
- # cljsrn (5)
- # clojure (113)
- # clojure-australia (4)
- # clojure-europe (40)
- # clojure-nl (8)
- # clojure-taiwan (1)
- # clojure-uk (60)
- # clojurescript (59)
- # code-reviews (2)
- # conjure (1)
- # datahike (12)
- # events (1)
- # jobs (1)
- # kaocha (4)
- # lsp (24)
- # luminus (19)
- # malli (4)
- # off-topic (28)
- # pathom (10)
- # philosophy (1)
- # portal (6)
- # re-frame (3)
- # reagent (9)
- # remote-jobs (1)
- # shadow-cljs (31)
- # sql (24)
- # tools-deps (6)
- # xtdb (14)
This is just delightful
(defn hiccup [html]
(with-meta
html
{:portal.viewer/default :portal.viewer/hiccup}))
(defn pixel-grid [pixels]
(hiccup
[:div {:style {:display "flex"}}
(for [col pixels]
[:div {:style {:display "flex" :flex-direction "column"}}
(for [color col]
[:div {:style {:width "5px" :height "5px" :background-color (str "rgba(" (str/join "," color) ")")}}])])]))
(tap> (pixel-grid (:pixels @state)))
🆒 12

Since reagent is rendering this, I wonder if you still need a :key
on list elements :thinking_face:
You would need it if you are updating large lists, but most of the time you can get by without it 👌