API: Primitives
LatestRequest
Interface reference for LatestRequest.
Overview
- Kind: Interface
- Source: packages/primitives/src/combobox/combobox-request.ts:3
Declaration
interface LatestRequest
Public methods
run
run<R>(task: (signal: AbortSignal) => Promise<R>): Promise<R | undefined>
Runs task as the current request. Any earlier request is aborted (its AbortSignal fires)
and its result is discarded even if the task ignores the signal. Resolves with the result,
or undefined when the request was superseded, cancelled or aborted.
| Parameter | Type | Optional | Description |
|---|---|---|---|
task |
(signal: AbortSignal) => Promise<R> |
cancel
cancel(): void
Aborts the in-flight request, if any. Called automatically when the owner is destroyed.