Methods
-
subscribeToQuerySelector( callback, filter, bind, group ) → {Object}
-
Description
Subscribes to mutations that affect an element matching a selector.
Parameters
Name Type Description callback
function A function to call when on a mutation
filter
function A function to call to filter mutations
bind
Any Something to bind the callback to
group
Boolean Whether to call the callback with an array of mutations instead of a single mutation
Returns
Details
-
observe()
-
Description
Starts observing the element. This will be called when attaching a callback. You don't need to call this manually.
Details
-
disconnect()
-
Description
Disconnects this observer. This stops callbacks being called, but does not unbind them. You probably want to use observer.unsubscribeAll instead.
Details
-
subscribe( callback, filter, bind, group ) → {Object}
-
Description
Subscribes to mutations.
Parameters
Name Type Description callback
function A function to call when on a mutation
filter
function A function to call to filter mutations
bind
Any Something to bind the callback to
group
Boolean Whether to call the callback with an array of mutations instead of a single mutation
Returns
Details
-
unsubscribe( subscription )
-
Description
Removes a subscription and disconnect if there are none left.
Parameters
Name Type Description subscription
Object A subscription object returned by observer.subscribe
Details