Documentation
¶
Overview ¶
Package mutation provides a wrapper for the MutationObserver API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observer ¶
Observer wraps a MutationObserver javascript object
func New ¶
New creates a new wrapper around MutationObserver, which is created with the given callback
func (*Observer) Disconnect ¶
func (m *Observer) Disconnect()
Disconnect stops the observer from receiving events
func (*Observer) Observe ¶
func (m *Observer) Observe(n dom.Node, i ObserverInit)
Observe registers a DOM Node to receive events for
func (*Observer) TakeRecords ¶
TakeRecords empties the record queue, returning what was in it
type ObserverInit ¶
type ObserverInit struct {
ChildList bool
Attributes bool
CharacterData bool
Subtree bool
AttributeOldValue bool
CharacterDataOldValue bool
AttributeFilter []string
}
ObserverInit contains the options for observing a Node
type Record ¶
type Record struct {
*js.Object
Type string `js:"type"`
AttributeName string `js:"attributeName"`
AttributeNamespace string `js:"attributeNamespace"`
OldValue string `js:"oldValue"`
}
Record is a wrapper around a MutationRecord js type
func (*Record) AddedNodes ¶
AddedNodes returns any nodes that were added
func (*Record) NextSibling ¶
NextSibling returns the next sibling to any added or removed nodes
func (*Record) PreviousSibling ¶
PreviousSibling returns the previous sibling to any added or removed nodes
func (*Record) RemovedNodes ¶
RemovedNodes returns any nodes that were added