elm-lang/dom/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Dom.LowLevel

This library backs user facing libraries like elm-lang/mouse and elm-lang/window that expose the functionality here in a much nicer way. In 99% of cases, you will find what you want in those libraries, not here.

Global Event Listeners

onDocument : String -> Decoder msg -> (msg -> Task Never ()) -> Task Never Never

Add an event handler on the document. The resulting task will never end, and when you kill the process it is on, it will detach the relevant JavaScript event listener.

onWindow : String -> Decoder msg -> (msg -> Task Never ()) -> Task Never Never

Add an event handler on window. The resulting task will never end, and when you kill the process it is on, it will detach the relevant JavaScript event listener.