Could also be something like:

attrs a = List.filterMap identity a
...
    let 
        title = if condition then Just (title "some title") else Nothing
            
        onClick = Nothing
        
    in 
        div (attrs [title, onClick]) [text "hello"]

On Tuesday, 24 January 2017 19:21:31 UTC-3, Robert Lee wrote:
>
> Would anyone else find --Html.Attributes.none-- useful?
>
> none : Html.Attribute a
>
> Use cases look like the following. 
>
> ....
>
> view: Model -> Html.Html Msg
>       let 
>             onClickButton = 
>                   case model.isClickedAlready of
>                         True -> 
>                               Html.Events.onClick Submit
>
>                          False ->  
>                                Html.Attributes.none
>       in 
>             Div [onClickButton] ....
>
> .....
>

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

Reply via email to