Fork me on GitHub
#re-frame
<
2017-05-07
>
lingeeal23:05:24

starting with the re-frame template I've added one entry in db.cljs

lingeeal23:05:26

`(def default-db {:name "re-frame" :example "bla"})`

lingeeal23:05:16

no from one component's on-change function I run (re-frame/dispatch [:set-example])

lingeeal23:05:15

so the dispatch function runs (assoc db :example "pam")

lingeeal23:05:00

now, somewhere in the view I have (re-frame/subscribe [:name])

lingeeal23:05:22

why does it rerender? I imagined it would only rerender when the :name value in default-db changed

mikethompson23:05:56

Yes, it should only rerender when the value returned by (subscribe [:name]) changes (ie. does not compare = to last time)