plumatic / dommy

A tiny ClojureScript DOM manipulation and event library
758 stars 74 forks source link

Listening to js/window :load breaks with :advanced optimizations #101

Open jeaye opened 8 years ago

jeaye commented 8 years ago
(dommy/listen! js/window :load (fn [_] (println "meow")))

That works fine up to :simple optimizations, but breaks once you go higher. I've found that the issue also happens when selecting the body as well.

(dommy/listen! (sel1 :body) :load (fn [_] (println "meow")))

So far, I haven't found anything in dommy that works, with :advanced, for listening to onload. As a replacement, I've been using a more primitive approach.

(aset js/window "onload" (fn [_] (println "meow")))

Once this has been setup, all other dommy calls I'm making seem to work just fine. The indication here, I gather, is that the issue is with :load listening.