Skip to content

Commit

Permalink
Add Main function (following elm-node example)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isikyus committed Feb 18, 2017
1 parent 768c323 commit a958c2b
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions test-func.elm
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
port module Test exposing (..)
port module Test exposing (main)

-- Elm module to get a sense of how to call Elm from JS
-- Very roughly based on https://gist.github.com/evancz/e69723b23958e69b63d5b5502b0edf90

import Json.Decode
import String

init : ( Model, Cmd Msg )
init = ( Model "", Cmd.none )
-- and https://github.com/ElmCast/elm-node/blob/master/example/Example.elm

import Platform
import Platform.Cmd as Cmd
import Platform.Sub as Sub
import Task
import Console
import NodeProcess

main : Program Never Model Msg
main =
Platform.program
{ init =
( Model "",
Cmd.none
)
, update = update
, subscriptions = subscriptions
}

-- MODEL

Expand Down

0 comments on commit a958c2b

Please sign in to comment.