Last active
November 23, 2020 16:39
-
-
Save boolpath/8ea2b3080a858dfad0714f93a2621449 to your computer and use it in GitHub Desktop.
Let Over Hiccup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn form-2-component [] | |
(let [content "Hello, world!"] | |
(fn [] [:div content]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn create-counter-button [] | |
(let [counter (reagent.core/atom 0)] | |
(fn [] | |
[:button | |
{:on-click #(swap! counter inc)} | |
(str "Clicks: " (deref counter))]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun create-counter () | |
(let ((counter 0)) | |
(lambda () (incf counter)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [counter (reagent.core/atom 0)] | |
(fn [] | |
[:button | |
{:on-click #(swap! counter inc)} | |
(str "Clicks: " (deref counter))])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let (...) | |
(lambda () ...)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [counter (atom 0)] | |
(fn [] | |
(swap! counter inc))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [counter (reagent.core/atom 0)] | |
(fn [] | |
(swap! counter inc)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let ((counter 0)) | |
(lambda () | |
(incf counter))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment