Skip to main content

PresenceController

Purpose

A utility controller to wire up other stimulus actions when an element comes into or leaves the document.

Actions

ActionPurpose
--

Targets

TargetPurposeDefault
---

Classes

ClassPurposeDefault
---

Values

ValueTypeDescriptionDefault
name (Optional)StringIf provided, the presence events will be prefixed with the given name i.e. foo:presence:added, to allow you to wire up other controllers based on specifically named presence events-

Events

EventWhenDispatched onevent.detail
presence:added / ${nameValue}:presence:addedWhen the element enters the DOMthe controller root element-
presence:removed / ${nameValue}:presence:removedWhen the element leaves the DOMthe controller root element-

Side Effects

None

How to Use