evancz/elm-html — pull request #5 by shaydon (2014-08-18 12:48:14+00:00)
Title: Make "on" work with any event name

Hi. I've found myself wanting to use Html.on(..) with some less-common, possibly non-standard events. (In my case "search" and "touchdown".) At present since their names aren't listed in the javascript array commonEvents, the DOMDelegator is never asked to listen for them and they are ignored. This patch simply adds a call to DOMDelegator.listenTo() in the createListener function itself - as listenTo is a no-op if called more than once this seems fairly harmless, but perhaps there's a better place for it?

Alternatively, if the intention is that on(..) should only be used with a fixed set of standard events, perhaps these should be documented on the Elm side? (Or on(..) changed to take an ADT rather than a string.)

[I should say so far I've only actually tested this on your master branch, not on the refresh.]