This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-17
Channels
- # beginners (70)
- # boot (4)
- # cider (16)
- # clara (6)
- # cljdoc (21)
- # cljs-dev (2)
- # cljsrn (1)
- # clojure (73)
- # clojure-finland (2)
- # clojure-nl (6)
- # clojure-russia (35)
- # clojure-sg (1)
- # clojure-spec (14)
- # clojure-uk (146)
- # clojurebridge (2)
- # clojurescript (128)
- # cryogen (2)
- # cursive (20)
- # datomic (27)
- # emacs (6)
- # events (8)
- # figwheel-main (57)
- # fulcro (46)
- # hoplon (3)
- # hyperfiddle (2)
- # immutant (3)
- # jobs (6)
- # jobs-discuss (15)
- # juxt (2)
- # off-topic (33)
- # parinfer (2)
- # portkey (4)
- # protorepl (1)
- # re-frame (4)
- # reagent (78)
- # ring-swagger (45)
- # schema (6)
- # shadow-cljs (167)
- # spacemacs (2)
- # specter (13)
- # tools-deps (6)
i'm learning reframe right now. I'm rendering a list of github issues in my app-state db. I'd like some local state in a reagent/atom to remember if they are collapsed or not. and this works just fine. However if i reload a different list of issues it does not re-render with the new list but rather keeps the old list of issues
(defn issue-summary [{:keys [title body created_at closed_at]}]
(let [collapsed (r/atom true)]
(fn [_props]
[:div
[:h4.list-group-item-heading {:onClick #(swap! collapsed not)}
[:i.fas.fa-bookmark] \space
title
(nice-time created_at)]
(when-not @collapsed
[:pre.issue-text {:style {:white-space :pre-wrap}} (possibly-truncated body)])])))