Skip to main content
Version: v2

LatestData Interface

State of a value and its metadata.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature​

/** @sealed */
export interface LatestData<T, TValueAccessor extends ValueAccessor<T>>

Type Parameters​

ParameterConstraintDescription
T
TValueAccessorValueAccessor<T>

Properties​

PropertyTypeDescription
metadataLatestMetadataMetadata associated with the value.
valueAccessor<T, TValueAccessor>The value of the state or an accessor function.

Property Details​

metadata​

Metadata associated with the value.

Signature​

metadata: LatestMetadata;

Type: LatestMetadata

value​

The value of the state or an accessor function.

Signature​

value: Accessor<T, TValueAccessor>;

Type: Accessor<T, TValueAccessor>

Remarks​

If the State object was created with a StateSchemaValidator, then the value will be a function returning a validated, deeply readonly T or undefined. Without a validator, value will be an unvalidated, deeply readonly T.

Any T is always deeply readonly, meaning it cannot be modified.