MattCheely / tryframe-coordinator / Message.AppToHost

This module exposes a type representing all of the messages that can be passed from a host application to the host library. It's a fairly direct mapping to the host-facing API.


type AppToHost
    = Publish Message.PubSub.Publication
    | Subscribe String
    | Unsubscribe String
    | RouteChange Path

This custom type is just a set of variants for each valid message the app can send to the host library. See the individual type descriptions for more details on message structures.

decodeFromApp : Json.Decode.Decoder AppToHost

Decoder for parsing incoming messages from the application to the relevant types. Bad input from apps will produce nice console errors that describe the exact failure.