bornhack-website/schedule/src/WebSocketCalls.elm

24 lines
512 B
Elm
Raw Normal View History

2017-07-20 09:18:14 +00:00
module WebSocketCalls exposing (sendInitMessage)
-- Internal modules
import Messages exposing (Msg)
-- External modules
import WebSocket
import Json.Encode
2017-07-20 09:18:14 +00:00
sendInitMessage : String -> String -> Cmd Msg
sendInitMessage camp_slug scheduleServer =
WebSocket.send scheduleServer
(Json.Encode.encode 0
(Json.Encode.object
[ ( "action", Json.Encode.string "init" )
, ( "camp_slug", Json.Encode.string camp_slug )
]
)
)