Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
t

ComponentLifecycleHooks

trait ComponentLifecycleHooks[Props, Msg, Model]

The dynamic hooks of one LiveComponent instance, with one registry per stage.

Reach it as ctx.hooks in the component's mount, update, message, and after-render contexts. In each stage, dynamic hooks run after the component's static hooks, in attachment order, and stay until detached or until the instance is removed. A change applies from the next dispatch of its stage. Hooks also receive the instance's current props. See dynamic hooks.

Defined by scalive.ComponentLifecycleHooks. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:445-456)

Methods4

afterRender

def afterRender: ComponentAfterRenderHooks[Props, Msg, Model]

Attaches and detaches hooks that run after each render of this instance.

Defined by scalive.ComponentLifecycleHooks.afterRender. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:456-456)

async

def async: ComponentAsyncHooks[Props, Msg, Model]

Attaches and detaches hooks that run when a task this instance started completes.

Defined by scalive.ComponentLifecycleHooks.async. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:453-453)

event

def event: ComponentEventHooks[Props, Msg, Model]

Attaches and detaches hooks that run for each message sent to this instance.

Defined by scalive.ComponentLifecycleHooks.event. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:450-450)

rawEvent

def rawEvent: ComponentRawEventHooks[Props, Msg, Model]

Attaches and detaches raw event hooks, which see each event routed to this instance.

Defined by scalive.ComponentLifecycleHooks.rawEvent. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:447-447)