lamdera/program-test/2.0.0

NOTE: the latest version is 4.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.

Effect.Lamdera

backend

(toBackend -> Cmd frontendMsg)
-> { init :
Url -> Key -> ( model, Command FrontendOnly toBackend frontendMsg )
, view : model -> Document frontendMsg
, update :
frontendMsg
-> model
-> ( model, Command FrontendOnly toBackend frontendMsg )
, updateFromBackend :
toFrontend
-> model
-> ( model, Command FrontendOnly toBackend frontendMsg )
, subscriptions : model -> Subscription FrontendOnly 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

(toFrontend -> Cmd backendMsg)
-> (String -> toFrontend -> Cmd backendMsg)
-> { init :
( backendModel, Command BackendOnly toFrontend backendMsg )
, update :
backendMsg
-> backendModel
-> ( backendModel, Command BackendOnly toFrontend backendMsg )
, updateFromFrontend :
-> toBackend
-> backendModel
-> ( backendModel, Command BackendOnly toFrontend backendMsg )
, subscriptions :
backendModel -> Subscription BackendOnly backendMsg
}
-> { init : ( backendModel, Cmd backendMsg )
, update :
backendMsg -> backendModel -> ( backendModel, Cmd backendMsg )
, updateFromFrontend :
String
-> String
-> toBackend
-> backendModel
-> ( backendModel, Cmd backendMsg )
, subscriptions : backendModel -> Sub backendMsg
}

Create a Lamdera backend application

sendToBackend : toBackend -> Command FrontendOnly toBackend frontendMsg

Send a toBackend msg to the Backend

sendToFrontend : ClientId -> toFrontend -> Command BackendOnly toFrontend backendMsg

Send a toFrontend msg to the Frontend

-> toFrontend
-> Command BackendOnly toFrontend backendMsg

Send a toFrontend msg to all the frontends that have a given SessionId.

broadcast : toFrontend -> Command BackendOnly toFrontend backendMsg

Send a toFrontend msg to all currently connected clients

(SessionId -> ClientId -> backendMsg)
-> Subscription BackendOnly backendMsg

Subscribe to Frontend client connected events

(SessionId -> ClientId -> backendMsg)
-> Subscription BackendOnly backendMsg

Subscribe to Frontend client disconnected events

Temporary integration

(toMsg -> Cmd msg)
-> (String -> toMsg -> Cmd msg)
-> (toMsg -> Cmd msg)
-> Command restriction toMsg msg
-> Cmd msg

Escape hatch for converting a Command to a regular Cmd in non-test code.