You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 21, 2018. It is now read-only.
Elm Decode Pipeline docs - http://package.elm-lang.org/packages/NoRedInk/elm-decode-pipeline/latest
26
+
27
+
## Exercises
28
+
29
+
There are 3 strings of raw JSON for you to decode into elm values (in `SampleJson.elm`), and three files set up for you (`Todo.elm`, `DeeplyNested.elm`, `Guardian.elm`)
30
+
For now all you need to do is render the result of the decoder to the screen
31
+
32
+
### 1. Decode Todos JSON
33
+
34
+
Turn the string of todos JSON into a list of todos `List Todo`
+ Think of your decoders as bits of lego that you can plug together (start small and build them into bigger pieces)
114
+
+ Always start with your core data structure (e.g. your `Article` or `Todo`)
115
+
+ The order of the keys that you decode is the same order that they are defined in your record type (the `Article` constructor is just a function that takes 3 strings and returns an `Article`)
116
+
+ Your Elm Data doesn't have to have the same nesting as the JSON! Even though the data may be deeply nested in the JSON, your decoders will most likely flatten it into a more useful structure
0 commit comments