Askr documentation
Reference

Glossary

Glossary: published entrypoints, signatures, and the constraints around them.

Example

// The vocabulary on this page, as it appears in code.
const [count, setCount] = state(0);        // state: a mutable fact you own
const doubled = derive(() => count() * 2); // derived value: recomputed, never copied
const pageRegistry = createRouteRegistry(() => {
  route('/projects/{projectId}', ProjectPage); // route: a path plus its component
});

Runtime terms

State is a readable/settable cell created by state(), returned as a tuple-like StateTuple<T> you can both call and destructure. Scope is a defineScope()/readScope() pair for passing a value down the component tree without prop drilling. Derived and Selector wrap derive() and selector() — computed values that stay in sync with their sources without you manually re-running the calculation.

Routing terms

A route is registered with route(path, component, options?) and matches a RouteContext carrying params, pathname, search, hash, and an AbortSignal. Route mode is one of 'spa' | 'ssr' | 'ssg', and an access decision from a route policy is one of allow, redirect (with a status like 301–308), or deny (401/403/404).

Data terms

A query (from @askrjs/askr/data) tracks async data with loading, error, stale, refreshing, and pending-write states — the same states @askrjs/askr/testing's mockQuery lets you construct directly for tests. Invalidation marks a cache prefix as stale so the next read triggers a refetch, and an invalidation recorder is the testing utility that captures those calls.

Rendering terms

A VNode is the lightweight render output shape — a string, number, boolean, null/undefined, or a DOMElement with type/props/children. A component instance is the runtime's bookkeeping record for one mounted component (its abort controller, state values, cleanup functions); hydration is the process of attaching that runtime bookkeeping to server-rendered markup already sitting in the DOM.