Fork me on GitHub
#re-frame
<
2018-08-17
>
dpsutton04:08:25

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

dpsutton04:08:53

(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)])])))

dpsutton04:08:30

am i thinking of this wrong?

dpsutton04:08:57

thanks for rubber ducking. it was a key-ing issue

👍 4