MattCheely / tryframe-coordinator / HostProgram

The HostProgram module is the Elm code that backs the frame-router custom element used in host applications. It handles mapping application routes to clients displayed in a child frame as well as message validation and routing within the parent application.

Create a program

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

Create a program to handle routing. Takes an input port to listen to messages on and and outputPort to deliver messages to the js embedder. port binding is handled in the custom frame-router element in LINK_TO_JS_LIB_HERE