Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
t

EventHooks

trait EventHooks[Msg, Model]

The dynamic event hooks of one LiveView lifecycle.

Defined by scalive.EventHooks. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:351-365)

Methods2

attach

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

Attaches hook under id, to run when a binding sends the view a message, before handleMessage.

A halt skips later hooks and handleMessage. Attaching an id that is already attached replaces that hook in place.

Defined by scalive.EventHooks.attach. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:358-362)

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.EventHooks.detach. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:365-365)