Dynamic
class Dynamic[Props, Msg, Model, Output](component: LiveComponent.WithOutput[Props, Msg, Model, Output], id: Signal[String])An instance of a component that reports outputs, whose ID follows a signal, as returned by
component(definition, id) with a Signal[String] ID.
A new ID renders a different instance, with its own model. It can only be rendered: to send it
a message or new props, build an instance with its current ID, as in
component(definition, currentId).
Parameters
componentThe component definition.
idThe instance's logical ID, unique among instances of the same component class.
Defined by scalive.LiveComponentOutputInstance.Dynamic. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:266-287)
Methods1
render
def render[OwnerMsg](props: Props, onOutput: Output => OwnerMsg): Mod[OwnerMsg]Renders the instance with the current ID at this place in the owner's view, with props,
and turns each of its outputs into an owner message with onOutput.
This form passes a constant props value.
Defined by scalive.LiveComponentOutputInstance.Dynamic.render. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:274-275)
def render[OwnerMsg](props: Signal[Props], onOutput: Output => OwnerMsg): Mod[OwnerMsg]Renders the instance with the current ID at this place in the owner's view, with props,
and turns each of its outputs into an owner message with onOutput.
This form passes props that follow a Signal; the instance receives each changed value in update.
Defined by scalive.LiveComponentOutputInstance.Dynamic.render. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:283-287)
Values2
component
val component: LiveComponent.WithOutput[Props, Msg, Model, Output]The component definition.
Defined by scalive.LiveComponentOutputInstance.Dynamic.component. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:267-267)
id
val id: Signal[String]The instance's logical ID, unique among instances of the same component class.
Defined by scalive.LiveComponentOutputInstance.Dynamic.id. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:268-268)