Skip to content

nelsonic/elm-tutorial-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial App

Learning elm routing via https://github.com/sporto/elm-tutorial

I downloaded the PDF version of @sporto's Elm Tutorial: https://www.elm-tutorial.org/en/

Then hand-wrote all the examples so that I would see the errors when I made typos/mistakes. I encourage you to do the same so you learn to read the debug/compiler error messages.

To run the code in this example, run the following:

1. Clone

git clone https://github.com/nelsonic/elm-tutorial-app.git && cd elm-tutorial-app

2. Install

npm install && elm-package install --yes

note: if you don't have elm or elm-package installed goto: https://guide.elm-lang.org/install.html

3. Run

npm start

Now Open the "App" in your web browser: http://localhost:3000/

You should see:

ui-final

Click to "Edit" one of the players:

increment-player-score

Increment or decrement.

That's it.

Conclusion

The reason this tutorial is a bit more than the typical increment/decrement example is that it's fetching the data from the "database" when the app starts and saving the records to the db.json "database".