Skip to content

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

@jeaye

Description

@jeaye
(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions