Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
t

AfterRenderHooks

trait AfterRenderHooks[Msg, Model]

The dynamic after-render hooks of one LiveView lifecycle.

Defined by scalive.AfterRenderHooks. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:421-435)

Methods2

attach

def attach(id: String)(hook: (Model, AfterRenderContext[Msg, Model]) => zio.package.Task[Unit]): zio.package.Task[Unit]

Attaches hook under id, to run after each render of the view and its components.

Every hook receives the rendered model; it cannot replace the model or halt, and a failure aborts the render. In a connected lifecycle it runs before the changes reach the browser. Attaching an id that is already attached replaces that hook in place.

Defined by scalive.AfterRenderHooks.attach. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:428-432)

detach

def detach(id: String): zio.package.Task[Unit]

Detaches the dynamic hook attached under id, if any. Static hooks cannot be detached.

Defined by scalive.AfterRenderHooks.detach. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:435-435)