An Elm Scroll package with no ports.
Note: This is a rough, rough prototype. I hacked this together on a flight in less than three hours.
- Add a subscription to the scroll function:
main =
Html.program { view = view, update = update, init = init, subscriptions = subscriptions }
subscriptions : Model -> Sub Msg
subscriptions model =
scroll ScrollEvent
- Create a message that takes a Position type:
= NoOp
| ScrollEvent Position
I am looking for feedback. Again, this is a rough prototype and there are lots of improvements to be made.