2017-07-20 09:18:14 +00:00
|
|
|
module WebSocketCalls exposing (sendInitMessage)
|
2017-07-17 09:25:57 +00:00
|
|
|
|
|
|
|
-- 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 =
|
2017-07-17 09:25:57 +00:00
|
|
|
WebSocket.send scheduleServer
|
|
|
|
(Json.Encode.encode 0
|
|
|
|
(Json.Encode.object
|
|
|
|
[ ( "action", Json.Encode.string "init" )
|
|
|
|
, ( "camp_slug", Json.Encode.string camp_slug )
|
|
|
|
]
|
|
|
|
)
|
|
|
|
)
|