I try to get my head around elm-parts.
My goal is to have 3 levels of nested components: A -> B -> Counter
I base my attempts
on https://github.com/debois/elm-parts/tree/master/examples
I have added the following function to Counter:
render1 : Parts.Get Model c -> Parts.Set Model c ->
They both have been already:
http://package.elm-lang.org/packages/debois/elm-mdl/4.0.0/
http://package.elm-lang.org/packages/debois/elm-parts/2.0.0/
On Thursday, May 19, 2016 at 11:27:46 AM UTC+2, Daniel Kwiecinski wrote:
>
> Any plans to update elm-mdl and elm-parts to 0.17?
>
> On Thursday,
As I understand it, you want to write a function which takes a list of TEA
components, then wires up and renders those. As Peter pointed out, this can
be done when your "components" are really just view functions. If they are
actual TEA components, each with (view, update, Model, Message,
Sounds very promising. Could you please provide minimalist example?
On Wednesday, 18 May 2016 13:47:16 UTC+1, Peter Damoc wrote:
>
> You just use regular Elm Architecture and compose the model of the
> autocomplete into the proper place, same with update and view.
>
> To speak in React
Oh, that's much easier:
import Html exposing (..)
import Html.Attributes exposing (class)
helloComponent name =
p [] [text ("Hello, " ++ name ++ "!")]
sayHello =
helloComponent "world"
listHello names =
div [] (List.map helloComponent names)
-- GENERIC WRAPPING COMPONENT
Oh, it looks just nesting views (I'm not familiar with ClojureScript
though). If so, the solution is much simpler. Like this:
```
container : List (Html msg) -> Html msg
container children =
div
[ style [ ("padding", "20px") ] ]
children
```
full version
Here is a sketch of how it would look like in reagent (ClojureScript)
; -- SOME CONCRETE COMPONENTS
; a component taking a String as a model
(defn hello-component [name]
[:p "Hello, " name "!"])
; a stateless component using another component
(defn say-hello []
[hello-component
Can you mock some code that would show how would you like to use this?
Imagine that it is already implemented in some library and write against
that imaginary library.
On Tue, May 17, 2016 at 5:36 PM, Daniel Kwiecinski <
daniel.kwiecin...@gmail.com> wrote:
> The problem is that the generic
Daniel,
I think normally, you don't. I think the constraint here is that you need
to explicitly set the types of each of the sub-components for every
component that you make for a page. In the example that you give, you'd
actually need to create 4 types of components: TopLevel, Counter,