MetricListener
The MetricListener
type describes a function that is used to listen to changes to a Metric
.
(
metrics: Metrics,
metricId: Id,
newMetric: Metric | undefined,
oldMetric: Metric | undefined,
): void
Type | Description | |
---|---|---|
metrics | Metrics | A reference to the |
metricId | Id | |
newMetric | Metric | undefined | The new value of the |
oldMetric | Metric | undefined | The old value of the |
returns | void | This has no return value. |
A MetricListener
is provided when using the addMetricListener
method. See that method for specific examples.
When called, a MetricListener
is given a reference to the Metrics
object, the Id
of the Metric
that changed, and the new and old values of the Metric
.
If this is the first time that a Metric
has had a value (such as when a table has gained its first row), the old value will be undefined
. If a Metric
now no longer has a value, the new value will be undefined
.
Since
v1.0.0