delMetricDefinition
The delMetricDefinition
method removes an existing Metric
definition.
delMetricDefinition(metricId: string): Metrics
Example
This example creates a Store
, creates a Metrics
object, defines a simple Metric
, and then removes it.
import {createMetrics, createStore} from 'tinybase';
const store = createStore().setTable('species', {
dog: {price: 5},
cat: {price: 4},
worm: {price: 1},
});
const metrics = createMetrics(store);
metrics.setMetricDefinition('speciesCount', 'species');
console.log(metrics.getMetricIds());
// -> ['speciesCount']
metrics.delMetricDefinition('speciesCount');
console.log(metrics.getMetricIds());
// -> []
Since
v1.0.0