Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/astynax/tea-combine
Combinator library for building "The Elm Architecture"-powered applications with ease
https://github.com/astynax/tea-combine
combinator elm elm-architecture hacktoberfest
Last synced: about 5 hours ago
JSON representation
Combinator library for building "The Elm Architecture"-powered applications with ease
- Host: GitHub
- URL: https://github.com/astynax/tea-combine
- Owner: astynax
- License: mit
- Created: 2016-11-13T14:58:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-10-14T18:37:07.000Z (about 3 years ago)
- Last Synced: 2024-11-22T03:32:10.976Z (about 1 month ago)
- Topics: combinator, elm, elm-architecture, hacktoberfest
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/astynax/tea-combine/latest
- Size: 140 KB
- Stars: 39
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TEA Combine
A set of combinators for working with stateful (and effectful) components.
Using this library you can do this:
```elm
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](https://github.com/astynax/tea-combine/blob/master/assets/example.png)](https://astynax.github.com/tea-combine/examples/pure/Simple.html)
[Here](https://medium.com/@mattia512maldini/the-principles-behind-tea-combine-49120b9137d0) you can find a good explanatory article (thanks to [Maldus512](https://github.com/Maldus512)!) about *how* all this stuff works!
### More examples
(All the sources you can find [here](https://github.com/astynax/tea-combine/tree/master/examples))
- [simple one](https://astynax.github.io/tea-combine/examples/pure/Main.html) with `Pure` combinators,
- [another](https://astynax.github.io/tea-combine/examples/pure/Recursive.html) pure but recursive,
- [one](https://astynax.github.io/tea-combine/examples/effectful/Main.html) with `Effectful` combinators,
- [another](https://astynax.github.io/tea-combine/examples/effectful/Recursive.html) effectful but recursive,
- [one](https://astynax.github.io/tea-combine/examples/form/Main.html) with form & binding,
- [one](https://astynax.github.io/tea-combine/examples/pages/Main.html) with multi-page layout,
- [another](https://astynax.github.io/tea-combine/examples/xor_pages/Main.html) multi-page one but with the state resetting on tab switch.