import Html exposing (..)
import Html.Attributes exposing (..)
import Event
type alias Message = (String, Maybe String, Maybe String)
eventSource : String
eventSource = "/event-source"
port message : Signal Message
port message =
Event.listen ["message" "error"] eventSource
toHtml : Message -> Html
toHtml (name, id, data) =
div [class name]
[text (case data of
Nothing -> ""
Just msg -> msg)]
main : Signal Html
main =
Signal.map toHtml message
-
Notifications
You must be signed in to change notification settings - Fork 0
Elm interface to EventSource
License
zakm/elm-event
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Elm interface to EventSource
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published