Created
November 14, 2017 10:34
-
-
Save forki/4169a2376b25e498d52584cf5e5e75e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let update (msg:Msg) model : Model*Cmd<Msg> = | |
match msg with | |
| ... | |
| Error exn -> | |
printfn "error: %A" exn.Message | |
model, Cmd.none | |
| Noop _ -> | |
model, Cmd.none | |
| NewHeartBeat (chargingPointID,heartbeat) -> | |
// ... | |
| Send m -> model, Cmd.ofFunc (Elmish.WebSocket.send model.WebSocket) m Noop Error | |
| ServerMsg Elmish.WebSocket.WebSocketMsg.Connected -> | |
{ model with Connected = true }, Cmd.ofMsg (Send SendHeartBeats) | |
| ServerMsg Elmish.WebSocket.WebSocketMsg.Disconnected -> { model with Connected = false }, Cmd.none | |
| ServerMsg (Elmish.WebSocket.WebSocketMsg.Error e) -> | |
printfn "error: %A" e | |
model, Cmd.none | |
| ServerMsg (Elmish.WebSocket.WebSocketMsg.Data msg) -> | |
model, | |
match msg with | |
| HeartBeat(chargingPointID,heartbeat) -> NewHeartBeat(chargingPointID,heartbeat) | |
|> Cmd.ofMsg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment