This guide follows the
0.1 API. Confirm the latest published version and migration notes before
installing a newer 0.x release.Find the cache
First identify where ordinary navigation reads this data. Prediction must populate that exact place. Here, aMap represents the router or query cache, and one key identifies an account’s first
Products page.
You need:
- A TypeScript application with
fetchandAbortController. - A read-only endpoint or router prefetch function.
- A host-owned cache that ordinary navigation already consumes.
- A stable key that includes every tenant and input dimension needed to identify one reusable representation.
Create the coordinator
Create one coordinator for the application scope so candidates share a concurrency and queue budget:openProducts() calls markReused() only after reading the predicted cache entry. The coordinator
controls the loader lifecycle but never owns ProductsPage. The ordinary fetch remains available
after a miss or failure.
Inspect outcomes
Every handle exposes a terminalcompletion promise, and the coordinator keeps bounded quality
history:
waiting_for_reuse until the host calls markReused() or
the horizon expires.
Material work that reaches the horizon without reuse becomes missed. Work reported with
materialWork: false represents an already-warm host cache and stays outside the material reuse
denominator.
Dispose cleanly
Calldispose() when the application shell that owns the coordinator is destroyed:
signal into cancellable I/O.
Continue
- Candidates and reuse defines candidate fields and accounting semantics.
- Scheduling and direct intent adds activity-aware delays and escalation.
- Browser runtime and navigation metrics connects visibility, connection, idle scheduling, and lead-time measurement.
- Client API reference lists the current package exports.