MattCheely / tryframe-coordinator / ClientProgram

The ClientProgram module is the Elm code that backs the client-side JS helper library in the iframe-coordinator library. It message handles message validation and delivery to and from clients. This module is not currently designed for stand-alone use. You should instead use the client library defined in iframe-coordinator to create seamless iframe applications

create : { fromHost : (Json.Decode.Value -> Msg) -> Platform.Sub.Sub Msg, toHost : Json.Decode.Value -> Platform.Cmd.Cmd Msg, fromClient : (Json.Decode.Value -> Msg) -> Platform.Sub.Sub Msg, toClient : Json.Decode.Value -> Platform.Cmd.Cmd Msg } -> Platform.Program () Model Msg

Create a program to handle client messages. Takes an record of ports to send and receive messages on. Communication with the parent application and the local client code are handled through four ports, an input and output pair for the client application and another pair for the host. Port bindings are handled and exposed via the iframe-coordinator library.