WebAssembly.Tools.Output

Summary

flush(chunks)

Flush nested list of HTML elements into a flat string

Functions

flush(chunks)

Specs:

Flush nested list of HTML elements into a flat string.

Flushing is not needed when you pass deep list of elements directly to Plug. Still it may come handy when testing, prototyping or using WebAssembly output together with template-based views.

Examples

iex(1)> use WebAssembly
:ok
iex(2)> doc = builder do: div do: (span "hey!")
["\n<div>", ["\n<span>", "hey!", "</span>"], "</div>"]
iex(3)> WebAssembly.Tools.Output.flush doc
"\n<div>\n<span>hey!</span></div>"