MCPcopy Create free account
hub / github.com/adobe/react-spectrum / append

Function append

packages/react-stately/src/data/useTreeData.ts:338–349  ·  view source on GitHub ↗
(parentKey: Key | null, ...values: T[])

Source from the content-addressed store, hash-verified

336 this.insert(parentKey, 0, ...values);
337 },
338 append(parentKey: Key | null, ...values: T[]) {
339 if (parentKey == null) {
340 this.insert(null, items.length, ...values);
341 } else {
342 let parentNode = nodeMap.get(parentKey);
343 if (!parentNode) {
344 return;
345 }
346
347 this.insert(parentKey, parentNode.children!.length, ...values);
348 }
349 },
350 remove(...keys: Key[]) {
351 if (keys.length === 0) {
352 return;

Callers

nothing calls this directly

Calls 1

insertMethod · 0.65

Tested by

no test coverage detected