Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class ExecuteScript(val script: Script, val autoRemove: Boolean = true, val attributes: List<Pair<String, String>> = emptyList(), val id: SseEventId? = null) : DatastarEvent

The datastar-execute-script event is used to execute JavaScript in the browser. The autoRemove line determines whether to remove the script after execution. Each attributes line adds an attribute (in the format name value) to the script element. Each script line contains JavaScript to be executed by the browser.

Link copied to clipboard
data class MergeFragments(val fragments: List<Fragment>, val mergeMode: MergeMode = morph, val selector: Selector? = null, val useViewTransition: Boolean = false, val settleDuration: SettleDuration? = DEFAULT, val id: SseEventId? = null) : DatastarEvent

The datastar-merge-fragments event is used to merge HTML fragments into the DOM. The fragments line should be a valid HTML fragment. The selector line should be a valid CSS selector. The mode line determines how the fragments are merged into the DOM. The useViewTransition line determines whether to use a view transition. The settleDuration line determines how long the transition should take.

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

The datastar-merge-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 line should be a valid data-store attribute. This will get merged into the store.

Link copied to clipboard
data class RemoveFragments(val selector: Selector, val id: SseEventId? = null) : DatastarEvent

The datastar-remove-fragments event is used to remove HTML fragments that match the provided selector from the DOM.

Link copied to clipboard
data class RemoveSignals(val paths: List<SignalPath>, val id: SseEventId? = null) : DatastarEvent

The datastar-remove-signals event is used to remove signals that match the provided paths from the store.

Properties

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

Functions

Link copied to clipboard