Type of the items.
Type of the key of an item.
Source to decorate.
chunkSize to cap the values of one call of the inner source.
a source with the same contract, batching resolve.
const departments = withBatching(createLookupSource(readDepartments, { textField: "name", valueField: "id" }));
// Rendered in the same tick, the cells share one `valueField in [1, 2]` request.
cell1.show(departments.resolve([1]));
cell2.show(departments.resolve([2]));
cell3.show(departments.resolve([1]));
Coalesces the
resolvecalls made in the same microtask into one call of the inner source with the distinct values, so the fifty cells of a grid page, each resolving its own key without knowing of the others, cost one request instead of fifty. Each caller receives the items of its own values, picked from the shared result withvalueOf; a value the inner source does not return is missing for every caller that asked for it; a rejected call of the inner source rejects every caller of the batch.searchandvalueOfare untouched.Signal. The call of the inner source runs without a signal: one caller's abort must not starve the others. The aborted caller alone rejects with
AbortedException, at once.Matching. A caller gets the items whose
valueOfis===to one of its values: a source matching keys loosely (the in-memory one compares strings case-insensitively by default) may return an item no caller recognises; keep the keys primitive and exact.