DataState
The state a data surface is in, named once so the surfaces converge on one vocabulary, though no component accepts it yet.
How this is generated
Source: lib/opsinjs.ts. Script: scripts/build-reference.mts. Command:
pnpm run generate.
Everything below is copied from the symbol, so a page is improved by improving its doc comment. The API index says why there is a page per symbol and what these pages still do not carry.
DataState
The state a data surface is in, named once so the surfaces converge on one vocabulary, though no component accepts it yet.
These are the five states the Data states foundation names, which are loading, error, empty, partial and stale, plus the resolved case where the value is real, current and simply rendered. The members are listed with the five doctrine states first and resolved last; the order a surface actually moves through them is the resolution order the foundation's flow diagram fixes, which is error first, then loading, empty, partial, stale and finally resolved.
No component accepts this type yet. It exists so that when the data surfaces do converge on a single state input they converge on one set of names rather than six, and because lib/opsinjs.ts is the substrate shadcn add copies into a consumer's project, a type declared here already travels with every installed component and costs nothing at runtime. Turning this alias into a running state machine, with a prop, a guard and a default, is a larger change this name does not stand in for.
| Kind | Declared in |
|---|---|
| type | lib/opsinjs.ts |
export type DataState =
| "loading"
| "error"
| "empty"
| "partial"
| "stale"
| "resolved"