Pebble.Companion.Storage
Persistent companion storage helpers.
Values and errors
Value
type Value
= StringValue String
| IntValue Int
| BoolValue Bool
| JsonValue Encode.ValueA stored companion value.
Error
type Error
= BridgeFailure BridgeError
| MissingPayload
| DecodeFailure StringErrors reported while reading companion storage.
Commands
set
set : String -> Value -> Cmd msgStore a value under a key.
get
get : String -> (Result Error Value -> msg) -> Cmd msgRead a stored value and deliver it to toMsg.
remove
remove : String -> Cmd msgRemove a stored key.
clear
clear : Cmd msgClear all stored values.
setup
setup : Cmd msgRegister the storage platform handler with the companion bridge.
Subscriptions
onStorage
onStorage : (Result Error Value -> msg) -> Sub msgReceive storage command responses routed through the platform bridge.