This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-04
Channels
- # beginners (46)
- # boot (65)
- # cider (8)
- # cljs-dev (5)
- # cljsrn (4)
- # clojure (50)
- # clojure-conj (2)
- # clojure-france (1)
- # clojure-greece (18)
- # clojure-russia (8)
- # clojure-spec (39)
- # clojure-uk (36)
- # clojurescript (36)
- # clr (16)
- # component (2)
- # cursive (6)
- # datascript (3)
- # datomic (31)
- # devcards (2)
- # editors-rus (1)
- # emacs (15)
- # events (2)
- # figwheel (1)
- # funcool (24)
- # garden (3)
- # hoplon (22)
- # instaparse (15)
- # leiningen (3)
- # luminus (4)
- # om (59)
- # onyx (24)
- # overtone (1)
- # pedestal (3)
- # planck (18)
- # prelude (1)
- # protorepl (2)
- # re-frame (5)
- # rum (1)
- # sql (1)
- # uncomplicate (1)
- # untangled (66)
- # vim (18)
- # yada (4)
@dm3 actually, now that i removed when-dom
there is no timeout needed for the events to update the hoplon elements
(deftest bind-events
(let [c (j/cell nil)
f #(reset! c true)
i (h/div :click f)
e (js/Event. "click")]
(is (nil? @c))
(.dispatchEvent i e)
(is (= true @c))))
this passes
@dm3 passes
@dm3 https://github.com/hoplon/hoplon/pull/154/files#diff-34c2d91d36b80e7d4a953549243960f0R18
i suppose the difference between an event you programatically trigger
vs an incoming event from the browser
yeah that’s pretty vague
this is what it was before: https://github.com/hoplon/hoplon/blob/84ac9191dec1beb4c57ffb4a3015166b2f84364e/src/hoplon/core.cljs#L486
that setTimeout 0 ensures that the fn is called after the dom has been built and all hoplon elements from the initial page load are in the dom etc