{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE CPP #-}
module Miso.EventSource
(
connectText
, connectJSON
, close
, socketState
, emptyEventSource
, EventSource (..)
, URL
, Payload (..)
) where
import Data.Aeson
import Miso.Effect
import Miso.Runtime
import Miso.String
connectText
:: URL
-> (EventSource -> action)
-> (MisoString -> action)
-> (MisoString -> action)
-> Effect parent model action
connectText :: forall action parent model.
URL
-> (EventSource -> action)
-> (URL -> action)
-> (URL -> action)
-> Effect parent model action
connectText = URL
-> (EventSource -> action)
-> (URL -> action)
-> (URL -> action)
-> Effect parent model action
forall action parent model.
URL
-> (EventSource -> action)
-> (URL -> action)
-> (URL -> action)
-> Effect parent model action
eventSourceConnectText
connectJSON
:: FromJSON value
=> URL
-> (EventSource -> action)
-> (value -> action)
-> (MisoString -> action)
-> Effect parent model action
connectJSON :: forall value action parent model.
FromJSON value =>
URL
-> (EventSource -> action)
-> (value -> action)
-> (URL -> action)
-> Effect parent model action
connectJSON = URL
-> (EventSource -> action)
-> (value -> action)
-> (URL -> action)
-> Effect parent model action
forall value action parent model.
FromJSON value =>
URL
-> (EventSource -> action)
-> (value -> action)
-> (URL -> action)
-> Effect parent model action
eventSourceConnectJSON
close
:: EventSource
-> Effect parent model action
close :: forall parent model action.
EventSource -> Effect parent model action
close = EventSource -> Effect parent model action
forall parent model action.
EventSource -> Effect parent model action
eventSourceClose