lamdera/core/1.0.0

A Lamdera package. It is not on package.elm-lang.org: the Lamdera compiler provides it, from static.lamdera.com, so lamdera install works and elm install does not.

Lamdera

backend

{ init : Url -> Key -> ( model, Cmd frontendMsg )
, view : model -> Document frontendMsg
, update : frontendMsg -> model -> ( model, Cmd frontendMsg )
, updateFromBackend :
toFrontend -> model -> ( model, Cmd frontendMsg )
, subscriptions : model -> Sub frontendMsg
, onUrlRequest : UrlRequest -> frontendMsg
, onUrlChange : Url -> frontendMsg
}
-> { init : Url -> Key -> ( model, Cmd frontendMsg )
, view : model -> Document frontendMsg
, update : frontendMsg -> model -> ( model, Cmd frontendMsg )
, updateFromBackend :
toFrontend -> model -> ( model, Cmd frontendMsg )
, subscriptions : model -> Sub frontendMsg
, onUrlRequest : UrlRequest -> frontendMsg
, onUrlChange : Url -> frontendMsg
}

Create a Lamdera frontend application

{ init : ( backendModel, Cmd backendMsg )
, update :
backendMsg -> backendModel -> ( backendModel, Cmd backendMsg )
, updateFromFrontend :
SessionId
-> ClientId
-> toBackend
-> backendModel
-> ( backendModel, Cmd backendMsg )
, subscriptions : backendModel -> Sub backendMsg
}
-> { init : ( backendModel, Cmd backendMsg )
, update :
backendMsg -> backendModel -> ( backendModel, Cmd backendMsg )
, updateFromFrontend :
SessionId
-> ClientId
-> toBackend
-> backendModel
-> ( backendModel, Cmd backendMsg )
, subscriptions : backendModel -> Sub backendMsg
}

Create a Lamdera backend application

sendToBackend : toBackend -> Cmd frontendMsg

Send a toBackend msg to the Backend

sendToFrontend : ClientId -> toFrontend -> Cmd backendMsg

Send a toFrontend msg to the Frontend

broadcast : toFrontend -> Cmd backendMsg

Send a toFrontend msg to all currently connected clients

onConnect : (SessionId -> ClientId -> backendMsg) -> Sub backendMsg

Subscribe to Frontend client connected events

onDisconnect : (SessionId -> ClientId -> backendMsg) -> Sub backendMsg

Subscribe to Frontend client disconnected events

clientConnected_ : SessionId -> ClientId -> Cmd msg

Internal only, do not use

clientDisconnected_ : SessionId -> ClientId -> Cmd msg

Internal only, do not use

type alias ClientId =
String
type alias SessionId =
String
type alias Url =
Url

Alias of elm/url:Url.Url

type alias Document msg =
Document msg

Alias of elm/browser:Browser.Document

type alias Key =
Key

Alias of elm/browser:Browser.Navigation.Key

type alias UrlRequest =
UrlRequest

Alias of elm/browser:Browser.UrlRequest

log : String -> a -> a

Log a message to either the console (dev) or the application log (prod)