Skip to content

Commit 16f3857

Browse files
author
Daniel Němec
committed
ELM tutorials update
1 parent 7f38bc5 commit 16f3857

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

tutorials/09_elm-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ lengthResult =
497497

498498
An extensible record is a record defined as _having at least certain fields_. For example, a record can be defined as having at least an `id` and `name` fields.
499499

500-
We can use extensible records for type inheritance. IT has one limitation - we will see it next lessonin Decoders part.
500+
We can use extensible records for type inheritance. It has one limitation - we will see it next lesson in Decoders part.
501501

502502
```elm
503503
type alias ExtensibleUser a =

tutorials/10_elm-tea.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ encodeTodo todo =
9595
]
9696
```
9797

98-
The object is representend as a list of key value tuples.
98+
The object is represented as a list of key value tuples.
9999

100100
## Http
101101

tutorials/11_elm-building-web-apps.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ route =
320320
-- /user/ ==> Nothing
321321
```
322322

323+
### Msg mapping
324+
325+
To be able to split page to more sub modules, we need to use `Html.map` [function](https://package.elm-lang.org/packages/elm/html/latest/Html#map) for mapping and combining views into single page. To see full example with mapping, you can go to [elm-spa](https://github.com/denynemec/elm-spa) and see all details. Note that we have also `Cmd.map` [function](https://package.elm-lang.org/packages/elm/core/latest/Platform-Cmd#map) and usually we need both. `Html.map` to be map view part and `Cmd.map` to map `Cmd` from sub modules (in update).
326+
327+
![Module mapping](./images/module-mapping.svg)
328+
323329
## Materials
324330

325331
- [elm-spa](https://github.com/deny1994/elm-spa)
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)