Pebble.Companion.Storage
Persistent key/value storage through the phone companion bridge.
import Pebble.Companion.Storage as Storage
saveHighScore =
Storage.set "score-save" "high-score" (Storage.IntValue 9001)
Values and errors
Commands
Results
Union Types
Value
type Valuetype Value
= StringValue String
| IntValue Int
| BoolValue Bool
| JsonValue Encode.ValueValues that can be stored by the companion bridge.
Error
type Errortype Error
= BridgeFailure BridgeError
| MissingPayload
| DecodeFailure StringStorage result errors.
Values
set
set : String -> String -> Value -> CommandEnvelopeStore a value under a key.
get
get : String -> String -> CommandEnvelopeRequest a value by key.
remove
remove : String -> String -> CommandEnvelopeRemove a value by key.
clear
clear : String -> CommandEnvelopeRemove all stored values.
decodeGet
decodeGet : ResultEnvelope -> Result Error ValueDecode the result of a `get` command.