Elm Pebble

Pebble.Events

Subscriptions for watch-side hardware and button events.

Each helper turns a platform event into a regular Elm `Sub msg`.

Tick

Buttons

Sensors

Composition

Values

onTick

onTick : (Int -> msg) -> Sub msg

Receive the current second on each clock tick from the runtime.

The value is the current wall-clock second, from `0` to `59`.

onHourChange

onHourChange : (Int -> msg) -> Sub msg

Receive a message when the local hour changes.

onMinuteChange

onMinuteChange : (Int -> msg) -> Sub msg

Receive a message when the local minute changes.

onButtonUp

onButtonUp : msg -> Sub msg

Receive a message when the Up button is pressed.

onButtonSelect

onButtonSelect : msg -> Sub msg

Receive a message when the Select button is pressed.

onButtonDown

onButtonDown : msg -> Sub msg

Receive a message when the Down button is pressed.

onButtonLongUp

onButtonLongUp : msg -> Sub msg

Receive a message when the Up button is long-pressed.

onButtonLongSelect

onButtonLongSelect : msg -> Sub msg

Receive a message when the Select button is long-pressed.

onButtonLongDown

onButtonLongDown : msg -> Sub msg

Receive a message when the Down button is long-pressed.

onAccelTap

onAccelTap : msg -> Sub msg

Receive a message when an accelerometer tap gesture fires.

batch

batch : List (Sub msg) -> Sub msg

Combine multiple Pebble subscriptions into one.