jamesrweb / elm-article

examples from an elm article as an example for stateful and stateless components.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elm Components: Stateful vs Stateless

Prerequisits

To run these examples you need to have Elm installed on your machine.

Installation via Brew

    brew install elm

Installation via executable

Go to the elm installation page.

Run the project

To run the project, execute the following from the project root:

    elm reactor

Navigate to the provided url in the command output and then select the Main.elm of the application you wish to run.

Compile the project

To compile the project you can use the elm make command.

To HTML

To compile the project to an index.html with all necessary JS included, you can run the following from the root directory:

    elm make src/<Application Name>/Main.elm

To JS

To compile the project to an index.js, you can run the following from the root directory:

    elm make src/<Application Name>/Main.elm --output index.js

Adding optimised output

To optimize the output JS you can add the --optimize flag to any of the above elm make commands.

About

examples from an elm article as an example for stateful and stateless components.


Languages

Language:Elm 100.0%