3 ms·
FWIW, here is the same example in clojurescript qlkit. It doesn't use "reactive atoms", just the usual state map approach. Of course qlkit's selling point (like
by drcode 7y ago
FWIW, here is the same example in clojurescript qlkit. It doesn't use "reactive atoms", just the usual state map approach. Of course qlkit's selling point (like for Om) is when global state needs to be synchronized to components, which isn't an issue in this example.
(ns qlkit-example.core
(:require [qlkit.core :as ql]))
(defcomponent Counter
(state {:count 0})
(render [atts {:keys [count] :as state}]
[:div [:p "You have clicked the button" count " times."]
[:button {:on-click #(ql/update-state! update :count inc)} "Increment"]]))
(ql/mount {:component Counter
:dom-element (js/document.getElementById "app")})