The following fits in good enough for me.
...
filterDiv : List (Maybe (H.Attribute msg)) -> List (Maybe (H.Html msg)) ->
H.Html msg
filterDiv a n =
H.div (List.filterMap identity a) (List.filterMap identity n)
...
measurements : Maybe (Int, Int)
...
isNotClicked: Bool
...
let
styleHeight m =
...
content =
...
in
filterDiv
[ Just (class "classy")
, when isNotClicked (onClick Submit)
, Maybe.map styleHeight measurements
]
[ Just content
]
On Wednesday, January 25, 2017 at 9:15:01 PM UTC+10, Rupert Smith wrote:
>
> On Tuesday, January 24, 2017 at 10:21:31 PM UTC, Robert Lee wrote:
>>
>> Would anyone else find --Html.Attributes.none-- useful?
>>
>
>
> +1 Yes.
>
> Also elm-mdl has a 'when' function which is very useful, and a version of
> it for Html.Attribute would be very handy:
>
> Button.disabled |> when (not model.isRunning)
>
> In a similar way to optional attributes, I find that when building the
> children of a dom node I end up having to code list manipulations that a
> 'when' operator could help with:
>
> div []
> [ someInnerDiv,
> someOptionalDiv |> when model.isSelected ]
>
> If there was an Html.none.
>
>
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.