mpizenberg/elm-touch-events/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

SingleTouch

This module exposes types and functions to deal with simple single touch interactions.

type alias SingleTouch =
{ touchType : TouchEvent
, touch : Touch
}

A simple type alias for a single touch event.

onSingleTouch : TouchEvent -> Options -> (SingleTouch -> msg) -> Attribute msg

A single touch event handler.

import Touch as T
import SingleTouch as ST

type Msg
  = TouchMsg T.TouchEvent T.Touch

view model =
  H.div [ ST.onSingleTouch T.TouchStart T.preventAndStop <| TouchMsg T.TouchStart ] []