You are viewing a single comment's thread from:

RE: My thoughts on Svelte - The magical disappearing UI framework

in #programming6 years ago (edited)

Nice article.
Maybe for the clojurescript counter exemple, the code can be more concise since you use javascript syntactic sugar too, no ?

(defn counter []
       (let [count (reagent/atom 0)]
         (fn []
           [:div {:style {:background "silver"
                          :padding 5}
                  [:p "Count: " @count " times"]
                  [:button {:on-click #(swap! count inc)} "+"]
                  [:button {:on-click #(swap! count dec)} "-"]
                  [:button {:on-click #(reset! count 0)} "Reset"]}])))