{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE CPP #-}
module Miso.WebSocket
(
connect
, send
, close
, socketState
, emptyWebSocket
, WebSocket (..)
, URL
, SocketState (..)
, CloseCode (..)
, Closed (..)
) where
import Miso.Effect
import Miso.Runtime
import Language.Javascript.JSaddle
connect
:: URL
-> (WebSocket -> action)
-> (Closed -> action)
-> (JSVal -> action)
-> (JSVal -> action)
-> Effect parent model action
connect :: forall action parent model.
URL
-> (WebSocket -> action)
-> (Closed -> action)
-> (JSVal -> action)
-> (JSVal -> action)
-> Effect parent model action
connect = URL
-> (WebSocket -> action)
-> (Closed -> action)
-> (JSVal -> action)
-> (JSVal -> action)
-> Effect parent model action
forall action parent model.
URL
-> (WebSocket -> action)
-> (Closed -> action)
-> (JSVal -> action)
-> (JSVal -> action)
-> Effect parent model action
websocketConnect
send
:: WebSocket
-> JSVal
-> Effect parent model action
send :: forall parent model action.
WebSocket -> JSVal -> Effect parent model action
send = WebSocket -> JSVal -> Effect parent model action
forall parent model action.
WebSocket -> JSVal -> Effect parent model action
websocketSend
close
:: WebSocket
-> Effect parent model action
close :: forall parent model action. WebSocket -> Effect parent model action
close = WebSocket -> Effect parent model action
forall parent model action. WebSocket -> Effect parent model action
websocketClose