Skip to content

Instantly share code, notes, and snippets.

@forki
Created November 14, 2017 10:31
Show Gist options
  • Save forki/90d69de794b3613f0dab5a2ab0deaba1 to your computer and use it in GitHub Desktop.
Save forki/90d69de794b3613f0dab5a2ab0deaba1 to your computer and use it in GitHub Desktop.
Init
let initModel user =
let ws = Elmish.WebSocket.createAuthenticated ("ws://localhost:8085/websocket", user.Token)
{ ChargingPoints = [||]
Reservations = Map.empty
WebSocket = ws
Connected = false
User = user },
Cmd.batch [
Cmd.ofPromise getChargingPoints () ChargingPointsLoaded Error
Elmish.WebSocket.Cmd.Configure ws ServerMsg
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment