ComponentSocket¶
API for LiveComponent lifecycle methods.
Provides assign management and push events. Unlike Socket, does not
provide PubSub subscription or InfoReceiver -- those are connection-level
concerns managed by the parent view.
Constructors¶
create¶
new ref create(
assigns: Assigns ref,
pending_events: Array[(String val , JsonValue)] ref)
: ComponentSocket ref^
Parameters¶
Returns¶
- ComponentSocket ref^
Public Functions¶
assign¶
Set a component assign value. The framework re-renders after the current handler if any assigns changed.
Parameters¶
- key: String val
- value: (String val | TemplateValue box)
Returns¶
- None val
get_assign¶
Read a component assign value.
Parameters¶
- key: String val
Returns¶
- TemplateValue box ?
push_event¶
Push a server-initiated event to the client. Events are queued and
flushed after the current render cycle, same as Socket.push_event.
Parameters¶
Returns¶
- None val