View Source LiveViewNative.Renderer (live_view_native v0.3.0)
This module contains logic on how template rendering and embedding is implemented
Summary
Functions
Embeds templates as render functions
Functions
Embeds templates as render functions
This function is mostly identical to Phoenix.Component.embed_templates/2
but deviates in a few ways
Options
:format
- the format from the client. This will be used for template discovery, for the format:swiftui
templates such ashome_live.swiftui.neex
will collected.:name
- the name of the generated function. Defaults to the name of the template, for exampleapp.swiftui.neex
will generateapp/2
. If this value is passed in there must only be a single template name matched. So if the pattern results in['home_live.swiftui.neex', 'user_list.swiftui.neex']
and you passname: :render
there is ambiguity and willraise
. The exception is when there are multiple targets for the same name:['home_live.swiftui+watchos.neex', 'home_live.swiftui+tvos.neex', 'home_live.swiftui.neex']
ifname: :render
this will result:def render(assings, %{"target" => "watchos"} = interface) def render(assigns, %{"target" => "tvos"} = interface) def render(assigns, interface)
the fallback function will always sort to render last. This allows for a greedy matcher if more than one target will be used for the same template.
:root
- the location from which thepattern
is applied to for finding templates. This is relative to the rendering module.