Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to generate an empty Html node in Elm-Html?

Tags:

elm

I'm writing a function that displays error messages, so in my view, I have something like

div [] [ displayErrors model ]

in the event that there are no errors, how can I make displayErrors return something that is interpreted as an empty Html node?

like image 295
jz87 Avatar asked Jul 27 '16 14:07

jz87


People also ask

How do I empty node JS?

You can also just call node. replaceChildren() and it will empty the node. It's quick, clean, and makes your intention clear.

What is HTML MSG in Elm?

The lower case msg is called a type variable. The upper case Msg is called a concrete type - its something your application has defined.


1 Answers

You can use an Html.text node with an empty string:

emptyNode = Html.text ""
like image 67
robertjlooby Avatar answered Oct 21 '22 05:10

robertjlooby