mutation

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeFilter

func AttributeFilter(val []string) func(*Options)

func AttributeOldValue

func AttributeOldValue(o *Options)

func Attributes

func Attributes(o *Options)

func CharacterData

func CharacterData(o *Options)

func CharacterDataOldValue

func CharacterDataOldValue(o *Options)

func ChildList

func ChildList(o *Options)

func Subtree

func Subtree(o *Options)

Types

type Callback

type Callback interface {
	HandleMutation([]Record, *Observer)
}

type CallbackFunc

type CallbackFunc func([]Record, *Observer)

func (CallbackFunc) HandleMutation

func (f CallbackFunc) HandleMutation(r []Record, o *Observer)

type Observer

type Observer struct {
	Callback Callback
	// contains filtered or unexported fields
}

func NewObserver

func NewObserver(cb Callback) *Observer

func (*Observer) Disconnect

func (o *Observer) Disconnect()

func (*Observer) Flush deprecated

func (o *Observer) Flush()

Deprecated: Flush is a temporary solution while developing, and is not intended to be called by client code.

func (*Observer) Observe

func (o *Observer) Observe(node dom.Node, options ...func(*Options)) error

Start observing for changes for a specific dom node.

Panics if the observer does not have a handler.

func (*Observer) Process

func (o *Observer) Process(e dom.ChangeEvent)

func (*Observer) TakeRecords

func (o *Observer) TakeRecords() (res []Record)

type Record

type RecordCallbackFunc

type RecordCallbackFunc func([]Record)

func (RecordCallbackFunc) HandleMutation

func (f RecordCallbackFunc) HandleMutation(r []Record, _ *Observer)

Jump to

Keyboard shortcuts

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