Skip to content

adeschamps/mdl-context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Helpers for elm-mdl render functions

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages