This module exposes an API for handling touch events.
Represents the internal model used by this library. The msg should be the
type of message used in your library; not Touch.Msg.
Use this to initialize the state of Touch.Model and to specify the
listeners.
This is used to update Touch.Model in response to a Touch.Msg. It also
creates a Cmd to trigger listeners. Use it like this:
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
TouchMsg touchMsg ->
Touch.update
touchMsg
model.touchMsg
( \newTouchModel -> { model | touchModel = newTouchModel } )Creates an HTML element that responds to touch events. The second argument
must be a function that converts a Touch.Msg to msg.
Listeners are like subscriptions but for touch events.
A listener that triggers when fingers move. The second argument must take the
X and Y distances (in pixels) and return a msg. The X and Y values are deltas,
so they are higher when the fingers are moving faster and 0 when they don't move.
Represents messages handled by this library