resolveTargets
resolveTargets(
props):ResolveTargetsResult
Defined in: packages/core/src/revalidate/resolveTargets.ts:50
Resolves the deduped, order-stable list of public paths to purge for a single document write, plus any route-route-map failures.
The one framework-agnostic piece of the revalidation feature — pure, no I/O — so a future TanStack adapter and a possible later server-side dispatch inherit identical semantics.
Parameters
Section titled “Parameters”The write description and the project’s route map.
Returns
Section titled “Returns”The deduped paths to purge, plus any mapper errors. Never throws —
a route-map failure is captured in errors, not propagated, because a broken
route map must never block a save.
Example
Section titled “Example”// Slug rename: "/about" -> "/company" — BOTH paths come back so the old// URL never serves stale content.resolveTargets({ map, collection: "pages", operation: "update", before: { _id: "1", _creationTime: 0, slug: "about" }, after: { _id: "1", _creationTime: 0, slug: "company" },});// → { paths: ["/about", "/company"], errors: [] }