Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
c

JSCommandBinding

class JSCommandBinding

Builder for a client lifecycle attribute, such as phx-mounted, which runs a JS command.

The Phoenix client runs only JS commands for these attributes, so the builder accepts nothing else. To send a message, push it from the command, as in dom.onMount(JS.push(Msg.Shown)). Obtain one from dom or connection.

Parameters

name

The phx-* attribute that the binding renders, such as phx-mounted.

Defined by scalive.JSCommandBinding. View source (scalive/api/src/scalive/HtmlElement.scala:458-471)

Methods1

apply

def apply[Msg](command: JSCommands.JSCommand[Msg]): Mod.Attr[Msg]

Runs command when the lifecycle point occurs.

This form runs a constant command.

Defined by scalive.JSCommandBinding.apply. View source (scalive/api/src/scalive/HtmlElement.scala:463-463)

def apply[Msg](command: Signal[JSCommands.JSCommand[Msg]]): Mod.Attr[Msg]

Runs command when the lifecycle point occurs.

This form runs the command that the signal currently holds.

Defined by scalive.JSCommandBinding.apply. View source (scalive/api/src/scalive/HtmlElement.scala:469-471)

Values1

name

val name: String

The phx-* attribute that the binding renders, such as phx-mounted.

Defined by scalive.JSCommandBinding.name. View source (scalive/api/src/scalive/HtmlElement.scala:458-458)