orus-io / elm-nats / Nats.PortsAPI

Defines the API for the ports that are required to interface with JS.


type alias Ports datatype msg =
{ send : Send datatype msg
, receive : Receive datatype msg 
}

This is the API that the ports module must implement.


type alias Command datatype =
Nats.Internal.Ports.Command datatype

A command for the js side


type alias Event datatype =
Nats.Internal.Ports.Event datatype

An event from the js side


type alias Send datatype msg =
Command datatype -> Platform.Cmd.Cmd msg

the port signature for sending commands to the js side


type alias Receive datatype msg =
(Event datatype -> msg) -> Platform.Sub.Sub msg

the port signature for receiving events from the js side