Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
c

Dynamic

class Dynamic[Props, Msg, Model](component: LiveComponent[Props, Msg, Model], id: Signal[String])

An instance of a stateful component 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

component

The component definition.

id

The instance's logical ID, unique among instances of the same component class.

Defined by scalive.LiveComponentInstance.Dynamic. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:201-216)

Methods1

render

def render(props: Props): Mod[Nothing]

Renders the instance with the current ID at this place in the owner's view, with props.

This form passes a constant props value.

Defined by scalive.LiveComponentInstance.Dynamic.render. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:208-208)

def render(props: Signal[Props]): Mod[Nothing]

Renders the instance with the current ID at this place in the owner's view, with props.

This form passes props that follow a Signal; the instance receives each changed value in update.

Defined by scalive.LiveComponentInstance.Dynamic.render. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:215-216)

Values2

component

val component: LiveComponent[Props, Msg, Model]

The component definition.

Defined by scalive.LiveComponentInstance.Dynamic.component. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:202-202)

id

val id: Signal[String]

The instance's logical ID, unique among instances of the same component class.

Defined by scalive.LiveComponentInstance.Dynamic.id. View source (scalive/api/src/scalive/lifecycle/LiveComponent.scala:203-203)