Skip to content

Commit

Permalink
Improvements in examples for View in main branch (#30)
Browse files Browse the repository at this point in the history
* Fix typo in textView example

* Improve example for Doc.BindView
  • Loading branch information
EduardoLR10 committed Aug 19, 2023
1 parent a5c6fb2 commit afe04b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/views.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ let vLength =
|> View.Map String.length
|> View.Map (fun l -> sprintf "You entered %i characters." l)
div [] [
Doc.Input [] varName
Doc.Input [] varTxt
textView vLength
]
```
Expand All @@ -135,10 +135,11 @@ let vWords =
|> View.Map (fun s -> s.Split(' '))
|> Doc.BindView (fun words ->
words
|> Array.map (fun w -> li [] [text w] :> Doc)
|> Array.map (fun w -> li [] [text w])
|> Doc.Concat
)
div [] [
Doc.InputType.Text [] varTxt
text "You entered the following words:"
ul [] [ vWords ]
]
Expand Down

0 comments on commit afe04b1

Please sign in to comment.