Heimdell / tea-combine

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

Home Page:http://package.elm-lang.org/packages/astynax/tea-combine/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.model
                |> 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

Examples (sources you can find here):

  • one with Pure combinators,
  • another pure but recursive,
  • one with Effectful combinators,
  • one with form & binding,
  • one with multi-page layout,
  • one with multi-page layout (with state reset on tab switch).

About

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

http://package.elm-lang.org/packages/astynax/tea-combine/latest

License:MIT License


Languages

Language:Elm 100.0%