A collection of helpers for dealing with elm-mdl render functions. This is motivated by the following observations:
- The triplet of
Mdl index model.mdl
occurs frequently in elm-mdl. - Dealing with indices is a bit tedious.
viewButton model index =
Button.render Mdl (0 :: index) model.mdl
[ Button.onClick Increment ]
[ text "Add" ]
This becomes
viewButton context model =
(Button.render |> withIndex context 0)
[ Button.onClick Increment ]
[ text "Add" ]
There is a simple example with a couple of counters:
$ cd example
$ elm-make App.elm