Skip to content

Instantly share code, notes, and snippets.

@nivekuil
Created October 21, 2023 19:50
Show Gist options
  • Save nivekuil/462169c78f9d6f74e8a6bf9eed7b84ca to your computer and use it in GitHub Desktop.
Save nivekuil/462169c78f9d6f74e8a6bf9eed7b84ca to your computer and use it in GitHub Desktop.
(dom/div
(let [!cs (atom [0 1 2 3 4]) cs (e/watch !cs)]
(e/for [c cs]
(ui/button
(e/fn [] (reset! !cs (vec (remove #{c} cs))))
(dom/props {:class "fade-in"})
(dom/text "REMOVE " c)))
(ui/button
(e/fn [] (swap! !cs conj (inc (peek cs))))
(dom/text "ADD"))))
@keyframes fade-in {
0% { opacity: 0; }
100% { opacity: 1;}
}
.fade-in {
animation: fade-in .5s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment