Skip to content

Instantly share code, notes, and snippets.

@boolpath
Last active November 23, 2020 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boolpath/8ea2b3080a858dfad0714f93a2621449 to your computer and use it in GitHub Desktop.
Save boolpath/8ea2b3080a858dfad0714f93a2621449 to your computer and use it in GitHub Desktop.
Let Over Hiccup
(defn form-2-component []
(let [content "Hello, world!"]
(fn [] [:div content])))
(defn create-counter-button []
(let [counter (reagent.core/atom 0)]
(fn []
[:button
{:on-click #(swap! counter inc)}
(str "Clicks: " (deref counter))])))
(defun create-counter ()
(let ((counter 0))
(lambda () (incf counter))))
(let [counter (reagent.core/atom 0)]
(fn []
[:button
{:on-click #(swap! counter inc)}
(str "Clicks: " (deref counter))]))
(let (...)
(lambda () ...))
(let [counter (atom 0)]
(fn []
(swap! counter inc)))
(let [counter (reagent.core/atom 0)]
(fn []
(swap! counter inc))
(let ((counter 0))
(lambda ()
(incf counter)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment