billstclair/elm-localstorage/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

LocalStorage.DictPorts

Simulate ports for using the LocalStorage module from elm reactor.

Types

type alias MsgWrapper msg =
Operation -> Maybe (Ports msg) -> Key -> Value -> msg

Your Msg, which wraps the key/value pair from a getItem return.

For real ports, you'll only care about the GetItem operation. You'll get Nothing for the Ports.

For simluated ports, you need to store the Ports in your Model.

Functions

make : MsgWrapper msg -> Ports msg

Create a Ports object from a message wrapper, usually just one of your Msg options.