Pebble.Storage

Watch-local key/value storage commands.

The watch runtime exposes a lightweight integer key/value store.

saveCounter : Cmd msg
saveCounter =
    writeInt 1 42

loadCounter : Cmd Msg
loadCounter =
    readInt 1 CounterLoaded

Native Pebble C API

Operations

writeInt

writeInt : Int -> Int -> Cmd msg

Store an integer value under an integer key.

readInt

readInt : Int -> (Int -> msg) -> Cmd msg

Read an integer by key and send it to toMsg.

writeString

writeString : Int -> String -> Cmd msg

Store a string value under an integer key.

readString

readString : Int -> (String -> msg) -> Cmd msg

Read a string by key and send it to toMsg.

delete

delete : Int -> Cmd msg

Remove a stored value at key.