Corex.Hook (Corex v0.2.0)

View Source

Attributes shared by every component root that mounts a JavaScript hook.

A hook root carries data-loading so CSS can style the pre-hydration frame, plus a phx-mounted that tells LiveView to stop patching that attribute once the hook removes it. The two must always agree on the attribute name, so they are emitted together rather than repeated per component.

Summary

Functions

Marks a hook root as loading until its hook clears the attribute.

Functions

loading()

@spec loading() :: map()

Marks a hook root as loading until its hook clears the attribute.

<div id={@id} phx-hook="Select" {Corex.Hook.loading()} {@rest}>