Fork me on GitHub
#membrane
<
2022-10-01
>
phronmophobic16:10:19

As I work my through writing more docs. I'm finding that it's sometimes easier to make improvements rather than explain some clunkiness. Anyways, just made an improvement to components so that they act more like values. Components have always been immutable, but they didn't work as expected if you tried to update them with assoc, update, etc. Now they do!

(def todo-view (todo-app {:todos
                          [{:complete? false
                            :description "first"}
                           {:complete? false
                            :description "second"}
                           {:complete? true
                            :description "third"}]
                          :next-todo-text ""}))
;; view it
(skia/run (constantly todo-view))
(def todo-view2
  (update-in todo-view [:todos 0 :complete?] not))
;; compare with old view
(skia/run (constantly
           (ui/horizontal-layout
            todo-view
            todo-view2)))

clj 3