Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
t

RawEventHooks

trait RawEventHooks[Msg, Model]

The dynamic raw event hooks of one LiveView lifecycle.

Defined by scalive.RawEventHooks. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:334-348)

Methods2

attach

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

Attaches hook under id, to run on each client event before it becomes a message.

The hook receives the event envelope as a LiveEvent, including events targeted at a component. A halt stops all processing of the event, by the view and by its components. Attaching an id that is already attached replaces that hook in place.

Defined by scalive.RawEventHooks.attach. View source (scalive/api/src/scalive/lifecycle/Hooks.scala:341-345)

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