getTableId
The getTableId
method returns the Id
of the underlying Table
that is backing a Metric
.
getTableId(metricId: Id): any
Type | Description | |
---|---|---|
metricId | Id | |
returns | any |
If the Metric
Id
is invalid, the method returns undefined
.
Example
This example creates a Metrics
object, a single Metric
definition, and then queries it (and a non-existent definition) to get the underlying Table
Id
.
const metrics = createMetrics(createStore());
metrics.setMetricDefinition('speciesCount', 'species');
console.log(metrics.getTableId('speciesCount'));
// -> 'species'
console.log(metrics.getTableId('petsCount'));
// -> undefined