pivotick / AsyncContent / RenderContext
Interface: RenderContext
Defined in: interfaces/AsyncContent.ts:58
Passed as the last argument to every async-capable content hook, so a consumer can abandon work the UI no longer needs.
Existing synchronous hooks simply ignore it — a one-argument callback stays assignable, and nothing about its timing changes.
Example
renderNodeExtra: async (node, { signal }) => {
const res = await fetch(`/enrich/${node.id}`, { signal })
return renderChips(await res.json())
}Extended by
Methods
isStale()
isStale():
boolean
Defined in: interfaces/AsyncContent.ts:71
true once this render has been superseded. A cheap guard for consumers doing non-abortable work, so they can bail out between steps without touching RenderContext.signal.
Returns
boolean
Properties
signal
readonlysignal:AbortSignal
Defined in: interfaces/AsyncContent.ts:65
Aborted when this render is superseded — the tooltip hid or reopened for another element, the selection changed, the panel was refreshed or removed, the graph was destroyed. Forward it to fetch and in-flight requests are cancelled instead of leaked.