GraphReFlyTS

API Reference

latestMeasurementValue()

Read the latest successful measurement value for a target/kind pair.

Import

import { latestMeasurementValue } from "@graphrefly/ts/solutions/reactive-layout";

Signature

function latestMeasurementValue(
	measurements: Measurements,
	targetId: string,
	measurementKind: string,
): T | undefined

Parameters

ParameterTypeDescription
measurementsMeasurementsMeasurement fact list to scan.
targetIdstringMeasurement target id.
measurementKindstringMeasurement kind tag.

Returns

The latest matching successful value, or undefined.

Example

latestMeasurementValue(measurements, "title", "text-segments");

Source

packages/ts/src/solutions/reactive-layout/measurements.ts