Skip to content

Instantly share code, notes, and snippets.

@jonasdw
Last active April 1, 2020 16:34
Show Gist options
  • Save jonasdw/c9e305c23248fa94e1d4d63a419b5009 to your computer and use it in GitHub Desktop.
Save jonasdw/c9e305c23248fa94e1d4d63a419b5009 to your computer and use it in GitHub Desktop.
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