typed-svg icon indicating copy to clipboard operation
typed-svg copied to clipboard

Events.on documentation wrong and function seems wrong too

Open colwem opened this issue 5 years ago • 1 comments

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

colwem avatar Jun 13 '19 17:06 colwem

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

mingan avatar Jun 22 '20 11:06 mingan