Created
May 28, 2015 09:22
-
-
Save yogsototh/43583ebe81d0658f1a16 to your computer and use it in GitHub Desktop.
elm Task or port bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Http | |
import Markdown | |
import Html exposing (Html) | |
import Task exposing (Task, andThen) | |
import Time exposing (every, second) | |
main : Signal Html | |
main = Signal.map Markdown.toHtml readme.signal | |
-- set up mailbox | |
-- the signal is piped directly to main | |
-- the address lets us update the signal | |
readme : Signal.Mailbox String | |
readme = Signal.mailbox "# try" | |
-- send some markdown to our readme mailbox | |
report : String -> Task x () | |
report markdown = Signal.send readme.address markdown | |
-- get the readme *and then* send the result to our mailbox | |
port fetchReadme : Signal (Task Http.Error ()) | |
port fetchReadme = Signal.map (\_ -> Http.getString readmeUrl `andThen` report) (every (30 * second)) | |
-- the URL of the README.md that we desire | |
readmeUrl : String | |
readmeUrl = "http://package.elm-lang.org/packages/elm-lang/core/latest/README.md" |
It appears it only occurs in elm-reactor in debug mode.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get the following error at runtime:
undefined is not an object (evaluating 'node.kids.forEach')
Open the developer console for more details.
But I find nothing interesting in the console.