Skip to content

Commit

Permalink
Change onWheel event to require a decoder.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Mar 4, 2016
1 parent 9f61c6a commit 68badd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/Html/Extra.elm
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ deltaDecoder =
Json.at ["deltaY"] Json.float

{-| An event listener that for the wheel event. -}
onWheel : Signal.Address a -> (Float -> a) -> Html.Attribute
onWheel address action =
Html.Events.on "wheel" deltaDecoder (\a -> Signal.message address (action a))
onWheel : Json.Decoder b -> Signal.Address a -> (b -> a) -> Html.Attribute
onWheel decoder address action =
Html.Events.on "wheel" decoder (\a -> Signal.message address (action a))

{-| Decodes the window dimesions. -}
windowDimensionsDecoder : Json.Decoder WindowDimensions
Expand Down

0 comments on commit 68badd2

Please sign in to comment.