elm-community / typed-svg

Typed SVG library written for Elm
BSD 3-Clause "New" or "Revised" License
59 stars 16 forks source link

Events.on documentation wrong and function seems wrong too #34

Open colwem opened 5 years ago

colwem commented 5 years ago

The documentation says both that the second arg is a Handler and that it's a Decoder a. The interface for all other packages like this is Decoder a It probably should be. But it isn't.|

Should maybe be

on : String -> Json.Decode.Decoder msg -> TypedSvg.Core.Attribute msg
on event decoder =
    VirtualDom.on event (VirtualDom.Normal decoder)

and not

on : String -> VirtualDom.Handler msg -> VirtualDom.Attribute msg
on =
    VirtualDom.on
mingan commented 4 years ago

Synced by https://github.com/elm-community/typed-svg/pull/41 in favour of the code signature, not the documentation.