Skip to content

@eightkk/vue-weave / core / resolveWindowedRequest

Function: resolveWindowedRequest() ​

resolveWindowedRequest<T, L>(state, requestId, response): WindowedDataSettlement<T, L>

Defined in: src/core/windowedData.ts:422

Applies the response of a request in flight: its items and links are merged into the data by ID (an item that an earlier, overlapping request already returned is replaced, never duplicated), and each of its cells becomes loaded or loaded-empty. A response is applied only while its request is in flight and belongs to the current condition; the response of an unknown, aborted or superseded request, or of a request of another condition, is ignored (applied: false). Throws Error for an item or link without a non-empty string ID or with an ID twice in the response, TypeError for a malformed response, and whatever an accessor throws; every check runs before anything is merged, so the state is then unchanged and nothing of the response is merged (report it with rejectWindowedRequest).

Type Parameters ​

T ​

T

L ​

L = never

Parameters ​

state ​

WindowedDataState<T, L>

requestId ​

string

response ​

WindowedDataPage<T, L> | readonly T[]

Returns ​

WindowedDataSettlement<T, L>

Released under the MIT License.