DatastarEvent

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class PatchElements(val elements: List<Element>, val mode: MorphMode = outer, val selector: Selector? = null, val useViewTransition: Boolean = false, val id: SseEventId? = null) : DatastarEvent

The datastar-patch-elements event is used to merge HTML elements into the DOM. The elements line should be a valid HTML syntax (tags can span multiple lines). The selector line should be a valid CSS selector. The mode line determines how the element are merged into the DOM. The useViewTransition line determines whether to use a view transition.

Link copied to clipboard
data class PatchSignals(val signals: List<Signal>, val onlyIfMissing: Boolean? = false, val id: SseEventId? = null) : DatastarEvent

The datastar-patch-signals event is used to update the store with new values. The onlyIfMissing line determines whether to update the store with new values only if the key does not exist. The signals lines should be a valid data-store attribute. These will get merged into the store.

Properties

Link copied to clipboard
Link copied to clipboard
open val id: SseEventId?
Link copied to clipboard

Functions

Link copied to clipboard
fun toSseEvent(): SseMessage.Event