-
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.
Answered by
gadfly361
May 11, 2018
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.
0 replies
Answer selected by
superstructor
-
@gadfly361 Thanks for your very quick response! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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.