trigger

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trigger

type Trigger struct {
	// contains filtered or unexported fields
}

Trigger represents an HTMX trigger See the https://htmx.org/headers/hx-trigger/ documentation for more information.

func NewTrigger

func NewTrigger(name string, value any) *Trigger

NewTrigger creates a new Trigger

type Triggers

type Triggers struct {
	// contains filtered or unexported fields
}

Triggers represents a collection of HTMX triggers

func NewTriggers

func NewTriggers() *Triggers

NewTriggers creates a new Triggers instance

func (*Triggers) Encode

func (t *Triggers) Encode(triggers map[string]*Trigger) (string, error)

Encode encodes the triggers by marshalling them into an HTMX JSON object

func (*Triggers) HasAfterSettleTriggers

func (t *Triggers) HasAfterSettleTriggers() bool

HasAfterSettleTriggers returns true if there are any after-settle triggers

func (*Triggers) HasAfterSwapTriggers

func (t *Triggers) HasAfterSwapTriggers() bool

HasAfterSwapTriggers returns true if there are any after-swap triggers

func (*Triggers) HasTriggers

func (t *Triggers) HasTriggers() bool

HasTriggers returns true if there are any triggers

func (*Triggers) Set

func (t *Triggers) Set(name string, value any)

Set sets a trigger, overwriting any existing trigger

func (*Triggers) SetAfterSettle

func (t *Triggers) SetAfterSettle(name string, value any)

SetAfterSettle sets a trigger to be called after settle, overwriting any existing after-settle trigger

func (*Triggers) SetAfterSwap

func (t *Triggers) SetAfterSwap(name string, value any)

SetAfterSwap sets a trigger to be called after swap, overwriting any existing after-swap trigger

func (*Triggers) TriggerAfterSettleHeader

func (t *Triggers) TriggerAfterSettleHeader() (string, error)

TriggerAfterSettleHeader returns the HTMX after-settle trigger as an HTTP header value

func (*Triggers) TriggerAfterSwapHeader

func (t *Triggers) TriggerAfterSwapHeader() (string, error)

TriggerAfterSwapHeader returns the HTMX after-swap trigger as an HTTP header value

func (*Triggers) TriggerHeader

func (t *Triggers) TriggerHeader() (string, error)

TriggerHeader returns all HTMX triggers as an HTTP header value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL