Last active
December 19, 2017 01:29
-
-
Save grrinchas/403faac01f0e17c7762b49dfa776c829 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Models exposing (..) | |
import Lorem | |
type alias Post = | |
{ id: String | |
, title : String | |
, body : String | |
} | |
type alias Model = | |
{ posts: List Post | |
} | |
initialPost : String -> Post | |
initialPost id = | |
{ id = id | |
, title = Lorem.sentence 4 | |
, body = Lorem.paragraphs 2 |> String.concat | |
} | |
initialModel : Model | |
initialModel = | |
{ posts = List.range 1 10 |> List.map toString |> List.map initialPost | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment