orus-io/elm-nats/1.0.0

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 =
Command datatype

A command for the js side

type alias Event datatype =
Event datatype

An event from the js side

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

the port signature for sending commands to the js side

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

the port signature for receiving events from the js side