skip to content

Watch

Observes changes to HYERBLAM element attributes and logs those changes using the element’s HTML as a template. Data props are included using square bracket syntax ([[prop]]). The available props are name (the attribute name), oldValue (the previous attribute value), newValue (the new attribute value), id (the element id if present, or the nodeName), and time (the approximate currentTime the attribute changed).

DRAFT! This element is in early development and is liable to change or possibly be replaced.

class
Watch
extends
Template
tag
<watch-blam>
see

Props

name type default description
allowed string

A space-separated set of attribute names to watch over. If not set, all attributes trigger templating/appending.

event string

not applicable

from string

A selector to match all the elements to watch for attribute changes. Filtered to only include HYPERBLAM elements.

additive boolean false

Whether to log cumulatively or to just log the most recent data.

max number 16

The number of times data is logged before clearing the to element and starting over. Stops the DOM getting too unwieldy.

value string null

not applicable

prop string null

not applicable

to string null

The id of the element to appended templated data to. If not set (null), it defaults to the Template-based element itself.

bypass boolean false

Whether to stop responding to events as they happen.

chance boolean 1

The probability that the event will be responded to. From 0 to 1.

Examples

Examples that use the Watch element: