-
Sorry for my noob question. It seems to me that I can do what re-frame does in reagent by defining a single global atom like this: ;; data store
(def global-store (r/atom {... initial map ...}))
;; event/dispatcher
(defn change-page [page] (swap! global-store update :page page))
;; view
(defn webpage [] [:button {:on-click #(change-page "clicked")} (:page @global-store)]) I know there must be something I am missing here. Could someone explain a bit on what advantages re-frame has over just using reagent? I googled and did not find an article on this.. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@IKZK Hey, glad you have found re-frame! :) Here is an answer to your question. As an aside, for future questions like this, there is a very friendly community on Clojure Slack in the #re-frame channel. |
Beta Was this translation helpful? Give feedback.
-
@gadfly361 Thanks for your very quick response! |
Beta Was this translation helpful? Give feedback.
@IKZK Hey, glad you have found re-frame! :)
Here is an answer to your question.
As an aside, for future questions like this, there is a very friendly community on Clojure Slack in the #re-frame channel.