You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code performs a 1 second debounce as I would expect:
(nstodomvc.core
(:require [reacl-c.main :as main]
[reacl-c.dom :as dom :include-macrostrue]
[reacl-c.core :as c :include-macrostrue]
[reacl-c-basics.debounce :as debounce]))
(defninit []
(main/run
(.getElementById js/document "app")
(c/fragment
(c/dynamic pr-str)
(debounce/debounce-delay1000 (c/with-state-as st
(dom/div;; add this line to notice the flip-flop behaviour:;; (c/init (c/return))
(dom/button {:onclick not}
(pr-str st))))))
{:initial-statefalse}
))
When you uncomment the (c/init (c/return)) line, the behaviour changes: Now when you click the button, the state toggles between true and false every second.
The text was updated successfully, but these errors were encountered:
This code performs a 1 second debounce as I would expect:
When you uncomment the
(c/init (c/return))
line, the behaviour changes: Now when you click the button, the state toggles between true and false every second.The text was updated successfully, but these errors were encountered: