Skip to content

Combinator library for building "The Elm Architecture"-powered applications with ease

License

Notifications You must be signed in to change notification settings

astynax/tea-combine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TEA Combine

A set of combinators for working with stateful (and effectful) components.

Using this library you can do this:

import Browser
import CheckBox
import Counter
import Html
import TeaCombine exposing (..)
import TeaCombine.Pure.Pair exposing (..)


main =
    Browser.sandbox
        { init =
            Counter.init 0
                |> initWith (CheckBox.init False)
                |> initWith (CheckBox.init False)
        , view =
            Html.div []
                << (joinViews Counter.view CheckBox.view
                        |> withView CheckBox.view
                   )
        , update =
            Counter.update
                |> updateWith CheckBox.update
                |> updateWith CheckBox.update
        }

and have an app that looks like this (image is clickable!):

screenshot

Here you can find a good explanatory article (thanks to Maldus512!) about how all this stuff works!

More examples

(All the sources you can find here)

  • simple one with Pure combinators,
  • another pure but recursive,
  • one with Effectful combinators,
  • another effectful but recursive,
  • one with form & binding,
  • one with multi-page layout,
  • another multi-page one but with the state resetting on tab switch.

About

Combinator library for building "The Elm Architecture"-powered applications with ease

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages