Skip to content

Commit

Permalink
add beginner code roadmap to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsuzuki committed Jun 25, 2016
1 parent 18594d4 commit 257f5d5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ This app is sparse on css on purpose.
The code is heavily-documented. If something is confusing,
submit an issue or PR and I'll improve the documentation there if possible.

## Beginners

If you haven't installed elm yet, do so [here](http://elm-lang.org/install).

I recommend following roughly this order for checking out the code:

`Main → Models → Messages → Update → View`

then in the `Todos` directory:

`Todos.[Models → Messages → Update → Commands → View → Edit]`

then if you're feeling confident:

`Utils`

## Getting Started

First, install dependencies:
Expand Down
2 changes: 0 additions & 2 deletions src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import Subscriptions exposing (subscriptions)
-- notice how there is no mention of "Todo" anywhere!
-- everything having to do with Todos is modularized and encapsulated

-- if you are new to elm, i recommend checking out Messages.elm next

main : Program Never
main =
Html.App.program
Expand Down
2 changes: 0 additions & 2 deletions src/Messages.elm
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ type Msg =
-- Todos.Message.Msg, then that would collide with the NoOp
-- in *this* Msg. Therefore, it needs to be wrapped.
| TodosMsg Todos.Messages.Msg

-- check out Update.elm next for how these messages are handled!
15 changes: 11 additions & 4 deletions src/Todos/Messages.elm
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@ import Todos.Models exposing (Todo, TodoEditView)


-- messages relevant to todos
-- explanations can be found in the Todos.Update module
-- more thorough explanations can be
-- found in the Todos.Update module
type Msg =
-- "no operation"
NoOp

| ShowEditView TodoEditView
| ChangeTitle String

-- http task success/fail messages
-- (type variables with the response's return data)
| Fail Http.Error
| FetchAllDone (List Todo)
| CreateDone Todo
| PatchDone Todo
| DeleteDone Todo

-- these are relevant to the Todos.Edit view
| ShowEditView TodoEditView
| ChangeTitle String
| CreateOrPatch

-- these are relevant to the Toos.List view
-- also, these trigger http commands
| Complete Todo
| Revert Todo
| Patch Todo
Expand Down

0 comments on commit 257f5d5

Please sign in to comment.