Copyright | (C) 2016-2025 David M. Johnson |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <code@dmj.io> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Miso.EventSource
Contents
Description
Synopsis
- connect :: URL -> (EventSource -> action) -> (JSVal -> action) -> (JSVal -> action) -> Effect parent model action
- close :: EventSource -> Effect parent model action
- socketState :: WebSocket -> (SocketState -> action) -> Effect parent model action
- emptyEventSource :: EventSource
- newtype EventSource = EventSource Int
- type URL = MisoString
EventSource
Arguments
:: URL | |
-> (EventSource -> action) | onOpen |
-> (JSVal -> action) | onMessage |
-> (JSVal -> action) | onError |
-> Effect parent model action |
close :: EventSource -> Effect parent model action Source #
socketState :: WebSocket -> (SocketState -> action) -> Effect parent model action Source #
Defaults
Types
newtype EventSource Source #
Constructors
EventSource Int |
Instances
Num EventSource Source # | |
Defined in Miso.Runtime Methods (+) :: EventSource -> EventSource -> EventSource # (-) :: EventSource -> EventSource -> EventSource # (*) :: EventSource -> EventSource -> EventSource # negate :: EventSource -> EventSource # abs :: EventSource -> EventSource # signum :: EventSource -> EventSource # fromInteger :: Integer -> EventSource # | |
Eq EventSource Source # | |
Defined in Miso.Runtime | |
ToJSVal EventSource Source # | |
Defined in Miso.Runtime Methods toJSVal :: EventSource -> JSM JSVal Source # toJSValListOf :: [EventSource] -> JSM JSVal Source # |
type URL = MisoString Source #
URL that the Websocket
will connect
to