Open swelet opened 4 years ago
Would also need to expose Node
.
Or expose 'on' functions specalized to window or document:
onWindow : String -> Decode.Decoder msg -> Sub msg
onDocument : String -> Decode.Decoder msg -> Sub msg
This would be useful for "online"
and "offline"
events that only happen on <body>
.
https://developer.mozilla.org/en-US/docs/Web/API/Document/ononline https://developer.mozilla.org/en-US/docs/Web/API/Document/onoffline
Thanks for all the work that you guys do.
I think the Browser.Events.on -function should be exposed.
With the Html.Events.on function we can listen for custom js-events on elements in the Dom. I miss a way of doing the same for Document through subscriptions. Say I want to use a custom drag and drop library in js, I could listen for this event:
but not make a subscription of this
I think exposing Browser.Events.on would be both useful and consistent with the api in Html.Events.