Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
t

LifecycleHooks

trait LifecycleHooks[Msg, Model]

The dynamic hooks of one LiveView lifecycle, with one registry per stage.

Reach it as ctx.hooks in mount, message, params, and after-render contexts. In each stage, dynamic hooks run after the view's static hooks, in attachment order, and stay until detached or until the lifecycle ends. A change applies from the next dispatch of its stage. The disconnected render has its own registry, which the connected lifecycle does not inherit. See dynamic hooks.

Defined by scalive.LifecycleHooks. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:312-331)

Methods6

afterRender

def afterRender: AfterRenderHooks[Msg, Model]

Attaches and detaches hooks that run after each render.

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

async

def async: AsyncHooks[Msg, Model]

Attaches and detaches hooks that run when a task the view started completes.

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

event

def event: EventHooks[Msg, Model]

Attaches and detaches hooks that run when a binding sends the view a message.

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

info

def info: InfoHooks[Msg, Model]

Attaches and detaches hooks that run for messages that do not come from a binding.

Defined by scalive.LifecycleHooks.info. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:325-325)

params

def params: ParamsHooks[Msg, Model]

Attaches and detaches hooks that run when a routed view receives new URL parameters.

Defined by scalive.LifecycleHooks.params. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:322-322)

rawEvent

def rawEvent: RawEventHooks[Msg, Model]

Attaches and detaches raw event hooks, which see each client event before it becomes a message.

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