Last active
April 1, 2020 16:34
-
-
Save jonasdw/c9e305c23248fa94e1d4d63a419b5009 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 Page | |
type Person = { | |
Name : string | |
Age: int | |
} | |
let printPerson = | |
FunctionComponent.Of ( | |
(fun (props: {| Person: Person; Dispatch: Msg -> unit |}) -> | |
div [ | |
OnClick (fun _ -> props.Dispatch IncrementAge props.Person.Id) | |
] [ | |
str "PERSON STUFF" | |
] | |
), "person-block", equalsButFunctions ); | |
let parent (persons: Map<string, Person list>) (dispatch: Msg -> unit) = | |
[ | |
div [] // | |
[ | |
for KeyValue(dagInWeek, persons) in persons do | |
persons | |
|> List.map (fun p -> printPerson {| Person = p; Dispatch = dispatch |} | |
|> ofList | |
] | |
] |> ofList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment