Interface QuerySnapshot<T>

Immutable snapshot of a cached query. The same object reference is returned from HonuaQueryCache.getSnapshot until the underlying state changes, which is what gives hooks their referential stability (NFR-001).

interface QuerySnapshot<T> {
    data: undefined | T;
    dataUpdatedAt?: number;
    error: unknown;
    isFetching: boolean;
    isLoading: boolean;
    status: QueryStatus;
}

Type Parameters

  • T

Hierarchy (view full)

Properties

data: undefined | T

Last resolved value. Preserved across background refetches.

dataUpdatedAt?: number

Epoch milliseconds of the last successful fetch, undefined until one resolves. Drives stale-while-revalidate decisions.

error: unknown

Last rejection reason, cleared on the next successful fetch.

isFetching: boolean

True whenever a fetch is in flight, including background refetches.

isLoading: boolean

True only while the first fetch (no data yet) is in flight.

status: QueryStatus