Lavash.Component.JsGenerator (Lavash v0.3.0-rc.5)

Copy Markdown View Source

Transpiles parsed HEEx template nodes to JavaScript template literal strings.

Used by subtree derive extraction to generate small JS render functions for :if/:for subtrees over optimistic state.

Summary

Functions

Transpile a parsed element node to a JS template literal string.

Functions

subtree_to_js(node)

Transpile a parsed element node to a JS template literal string.

Takes a node from Lavash.Template.parse/1 and returns a JS expression that produces the equivalent HTML. Used for subtree derives.