MCPcopy Index your code
hub / github.com/tinyplex/tinybase / useMetric

Function useMetric

src/ui-react/hooks.ts:1568–1577  ·  view source on GitHub ↗
(
  metricId: Id,
  metricsOrMetricsId?: MetricsOrMetricsId,
)

Source from the content-addressed store, hash-verified

1566 );
1567
1568export const useMetric: typeof useMetricDecl = (
1569 metricId: Id,
1570 metricsOrMetricsId?: MetricsOrMetricsId,
1571): number | undefined =>
1572 useListenable(
1573 METRIC,
1574 useMetricsOrMetricsById(metricsOrMetricsId),
1575 ReturnType.CellOrValue,
1576 [metricId],
1577 );
1578
1579export const useMetricListener: typeof useMetricListenerDecl = (
1580 metricId: IdOrNull,

Callers 5

ReaderFunction · 0.90
ContextMetricsChildFunction · 0.90
TestFunction · 0.90
MetricViewFunction · 0.90
MetricRowFunction · 0.90

Calls 2

useMetricsOrMetricsByIdFunction · 0.90
useListenableFunction · 0.70

Tested by 3

ReaderFunction · 0.72
ContextMetricsChildFunction · 0.72
TestFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…